0 points

Format currency


dashboard

Mon Jun 08 2020 10:26:33 GMT+0000 (UTC)

Posted by @salitha.pathi #javascript

amount
	.toFixed(2)
    .toString()
    .replace(/\B(?=(\d{3})+(?!\d))/g, ",")
    
// or

amount
	.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
content_copy Copy