Separate every three characters with commas
Regular method:
"115000000".split("").reverse().join("").replace(/(d{3})(?=[^$])/g, "$1,").split ("").reverse().join("");
var str = '123123211312.333123'.replace(/(?=(?!^)(?:d{3}) (?:.|$))(d{3}(.d $)?)/ g,',$1');
console.log(str)
'1500000000000'.replace(/B(?=(d{3}) $)/g,',')
Loop search method
toLocaleString function: