Number.prototype.toCurrency = function(floatPoint, decimalSep, thousandsSep, unit)
{
var n = this, c = isNaN(c = Math.abs(floatPoint)) ? 2 : c, d = decimalSep == undefined ? "." : decimalSep, t = thousandsSep == undefined ? "." : thousandsSep, i = parseInt(n = (+n || 0).toFixed(c)) + '', j = (j = i.length) > 3 ? j % 3 : 0;
...
JavaScript On Rails-like number_to_curren...
by Ali Karbassi,
October 21, 2007 23:57
Much easier way of doing this.