New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integers glitch after reaching a specific length #167
Comments
Javascript Numbers can't hold integers bigger than Math.pow( 2, 53 ) (all numbers in JS are floats, more info). So, basically you can't get an integer bigger than 17 digits length with its full precision. Globalize 1.x outputs the below, which I consider a regression compared to the previous output as shown in issue's description (I think the zero'ed result is better than the scientific notation one in this case, since user hasn't chosen so).
Clearly, we'd need an additional big numbers library to handle that. Although, this should be optional. @scottgonzalez, @jzaefferer, what do you think? Any ideas? |
It's hard to say that this is a bug when JavaScript can't distinguish between these numbers.
Supporting a big number implementation is something we can consider, but I think we'd want to wait on that. |
Can we throw an error instead of returning an incorrect value? |
|
This seems a very hard problem. I'm closing as won't fix. But, I am open for ideas and code suggestions. |
Failing test fixed in 95298d0 Fixes globalizejs#167
There is |
Thanks for the input |
I tried typing a number in that is longer than 18 digits, it replaces all the numbers at the end with 0
I believe the problems lies within the highlighted code
Example:
The text was updated successfully, but these errors were encountered: