Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS .toLocaleString() - Add comma into number

0 votes
6 views
added 6 days ago in Javascript by LC Marshal First Warrant Officer (11,130 points)
edited 5 days ago by LC Marshal
//Add the .toLocaleString() function next to value
console.log('5 year with/out dividend = ' + (Math.round(annual * 5 + e5)).toLocaleString() + '|' + (Math.round(annual * 5)).toLocaleString());
//e.g output 550467 to 550,467

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...