Re:Java DecimalFormat implemented in JavaScript
by huherto on Thursday February 10, 2011 @10:49AM
(#2202270)
In the case of currency, it is better to use decimal arithmetic because if you use float numbers the rounding behaves different than doing the same operations by hand or in a calculator. Another option is to use integers (to represent number of cents) and just print the decimal point when displaying the number.
[ Parent
| on HN ]
Re:Java DecimalFormat implemented in JavaScript
by euroclydon on Thursday February 10, 2011 @11:14AM
(#2202357)
I'm not sure if you're answering my question or not. I've inspected the source of both libraries, and they both use the JS method toFixed().