inter icon indicating copy to clipboard operation
inter copied to clipboard

Math float issue arises when formatting certain numbers

Open ragulka opened this issue 12 years ago • 1 comments

Trying to format a number like 123456789201921 reveals the underlying issue with float-precision math that JS has. The result is something like 123,456,789,201,920.992 while it should be 123,456,789,201,921.

I stumbled upon this while working on my own fork of Numeral-JS. The issue can probably only be solved if using a specialized library like Big.js

Of course, this is probably an edge case, but perhaps it is something to be considered.

ragulka avatar Dec 13 '13 18:12 ragulka

Sorry for the radio silence on this one. If you're still interested in finding a solution, what would you propose? To add support for formatting Big.js instances -- or maybe even strings?

papandreou avatar Dec 17 '15 07:12 papandreou