Hey guys,
Recently I had an issue in production saying the value was wrong when one is exponential, let say for example:
1.301684883426969e-8
This is a position coming from the GPS device, any chance to take this one into consideration? (I could contribute to a PR if think we should.)
Edit:
Ok I deep a bit since and I just saw it was a JS issue with a big decimal number, so maybe I should convert the number before using the validator?
@vschoener, PR is highly welcome.
Also, more people can test and vote in for bug fix on this part.
@ezkemboi Alright, I just need people to confirm about transforming the value before or if it should be handled.
@profnandaa, @tux-tn ping!
@vschoener -- I think any form of sanitation/standardization should be done before the function kicks in, since it will just be returning a true/false.
This is the general pattern across most of the lib, also since strings are immutable -- will be good to discourage the practice of sanitizing while validating.
That said, PR is welcome to cover for exp cases. 馃憤
Yeah I agree it's not really great to sanitize value before validation but right to transform it after.
I'll take a look then ;)
@vschoener are you sure you don't have an issue reading your GPS data?
I don't think that 0.00000001301684883426969 is a valid GPS Lat/Long, for reference a decimal place of 7 (1.1234567) is representing an accuracy of 1.1 centimeters
@tux-tn The data comes from the GPS device but I agree it's weird to have such data coming...
Thx for the detail, I'll talk about it here in my team see if we should handle the problem differently
Sure, might need to sanitize data coming from the device first on your own. Thanks for your contribution though and the discussion! 馃檹
Most helpful comment
@vschoener -- I think any form of sanitation/standardization should be done before the function kicks in, since it will just be returning a true/false.
This is the general pattern across most of the lib, also since strings are immutable -- will be good to discourage the practice of sanitizing while validating.
That said, PR is welcome to cover for
expcases. 馃憤