

Java DecimalFormat implemented in JavaScript - yalimgerger
http://gergerconsulting.blogspot.com/2010/07/javascript-decimalformat.html

======
bluedevil2k
Here's a much more robust number formatter for JavaScript, written as a jQuery
plugin.

<http://code.google.com/p/jquery-numberformatter/>

------
euroclydon
Why not just use Javascript sprintf?

[http://www.diveintojavascript.com/projects/javascript-
sprint...](http://www.diveintojavascript.com/projects/javascript-sprintf)

~~~
huherto
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.

~~~
euroclydon
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().

~~~
huherto
Never mind, you are right it is just to format decimals.

