Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Handle numbers greater that 10e21 and numbers that start with 0.followed by more than 5 zeros. #1

Open
Ynote opened this issue Nov 18, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@Ynote
Copy link
Owner

Ynote commented Nov 18, 2018

Description of the issue

As in JavaScript, number output is in fixed notation, except when it is greater that 10e21 and when it starts with 0.followed by more than 5 zeros (cf. http://2ality.com/2012/03/displaying-numbers.html), the cast to a number with parseFloat and the final string equality can only handle the range between 10e21 and 0.00000x cases.

Possible solution

Using a RegExp. In that case, is the usage of parseFloat still appropriate?

@Ynote Ynote added the enhancement New feature or request label Nov 18, 2018
@Ynote
Copy link
Owner Author

Ynote commented Nov 27, 2018

Another case in favor of using a RegExp : isStringANumber('042') doesn't return truebecause of the use ofparseFloat. Should 042returntrue` ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant