node-geohash
node-geohash copied to clipboard
Convert to string notation required for auto precision
It is possible to change
if (typeof(latitude) === 'number' || typeof(longitude) === 'number') {
throw new Error('string notation required for auto precision.');
}
To something like
if (typeof(latitude) === 'number') {
latitude = parseFloat(latitude).toString();
}
if (typeof(longitude) === 'number') {
longitude = parseFloat(longitude).toString();
}
or direct enforce input.toString(), without checks or parseFloats.
I'm not sure if parseFloat returns correct precision as user want. Explicitly disable this indecisive behavior is preferred.
can you show an example? I not see the problem...