I saw this beautiful script to add thousands separator to js numbers:
function thousandSeparator(n, sep) { var sRegExp = new RegExp(\'(-?[0-9]+)([0-9]{3
How about this one:
result = "1235423.125".replace(/\B(?=(\d{3})+(?!\d))/g, ',') //1,235,423.125