In Javascript following number
9999999999999999.99
Gets converted in to
10000000000000000
How can I prevent this behaviour?
In Javascript following number
9999999999999999.99
Gets converted in to
10000000000000000
How can I prevent this behaviour?
It's my understanding that the best way to deal with this is to do all your calculations in whole numbers, and divide by 100 (or plus as many zeros as needed) afterwards.
If you absolutely need to use decimals, this post contains a lot of useful information that should be of use to you.