Closed markerikson closed 8 years ago
Hi Mark,
Good find. How do you feel about making the fix yourself? I would accept the pull request from you containing these changes, provided all tests are passing.
Let me know, thanks!
Hi!
I had the same problem as Mark.
I tried out Mark's fix, but found some cases with a rounding problem, so I solved the problem in a different way.
I've submitted my solution in a pull request with this fix, passing all tests (including 2 new ones)
Sorry about the delay guys... I've finally merged your PR
Thanks for contributing!
And as it turns out, one of my coworkers noticed today that my "fix" was indeed truncating in some cases where it shouldn't. So yeah, this change ought to improve things. Thanks.
Saw some intermittent failures when trying to turn a decimal number into a result using .longitude(). Sample case:
Finally tracked it down. The issue is that you're using .toFixed() , which is rounding the seconds value of 59.99999 to 60. That causes the longitude validation check of "seconds < 60" to fail.
I was able to resolve the issue by pulling in a numerical truncation function, and use that instead of .toFixed():