Number.prototype.toLocaleString() a very helpful function to convert a number to locale format, ie. 12,345,678.90,

More here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString

var number = new Number(12345.6789);

// convert to locale string
console.log( number.toLocaleString('en',{minimumFractionDigits:2, maximumFractionDigits:2}) );