NumberFormat Error
themoviejunkie 1 | ||
This is an mredkj question.
The NumberFormat script seems to be having an error. I went to check the site: http://www.mredkj.com/javascript/numberFormatPage2.html When I entered a 17-digit value, for example 12345678901234567, the result has been changed to 12345678901234568.00. Do you have any idea what's going on? Also, when the input is more than 17, the result is not the same anymore. Issue happens on all browsers. Please help me D: |
||
![]() |
In reply to: themoviejunkie | |
Disclaimer: NumberFormat was last updated in 2006, so you may not want to use it anymore.
That said, it might be a bigger issue than just the NumberFormat script. In another one of our pages - http://www.mredkj.com/javascript/nfbasic2.html - I have a demonstration of the built-in javascript function "toFixed" which when I enter your example, results in the same incorrect number. I'm not aware of the latest on this issue, but at the time I wrote that page, I said there were issues with floating point calculations in javascript. You can refer to that same URL - http://www.mredkj.com/javascript/nfbasic2.html - for a brief explanation. If I get a chance, I can try to look into the latest on this issue, since a lot has changed in standards and browser implementations since then. |