formatcoords
formatcoords copied to clipboard
A simple and flexible tool to format decimal lat/lon coordinates into degrees/minutes/seconds formats (like DMS).
There is a rounding issue for seconds already reported [here](https://github.com/nerik/formatcoords/issues/5) To avoid the issue I would like to add "SS" and "S" formatting which is using seconds integer value.
Thank you for you amazing work. I hope typescript support will make this library even better.
Hi Thanks for the great project. Any way to convert back to Decimal coordinates?
Due to this test https://github.com/nerik/formatcoords/blob/master/index.js#L7 `formatcoords({lat: 0, lng: 0 })` produces NaN values.
I found a bug! If you provide coordinates as object and either lat or lng are 0, I will get 'NaN' as result. This pull request fixes this behavior and...
This is demonstrated in the tests in this branch https://github.com/alex028502/formatcoords/tree/roundoff-issue briefly this is the problem: ```javascript const coord = formatcoords(1 + 59.9 / 60 / 60, 0); expect(coord.format({decimalPlaces: 0})).to.equal('1° 1′...
Add TypeScript d.ts or simply use TypeScript to begin with. ```typescript declare module 'formatcoords' { interface FormatOptions { latLonSeparator?: string; decimalPlaces?: number; } /** * Formats decimal lat/lon coordinates into...