Fast and short way to format value of type Number as money, e.g. 1234567.89 => "1,234,567.89":
var num = 1234567.89,
formatted;
formatted = num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); // "1,234,567.89"
More advanced variant with support of any number o...