JavaScript format number with commas using toLocaleString()

JavaScript format number with commas using toLocaleString()

9 months ago
raja $aqm1-J6ZlN

const number = 1234567.89;

const formattedNumber = number.toLocaleString();

console.log(formattedNumber)

// Output: "1,234,567.89"

https://medium.com/@onlinemsr/big-numbers-no-worries-javascript-format-number-with-commas-17ec7f878834

Last Seen
9 months ago
Reputation
0
Spam
0.000
Last Seen
3 hours ago
Reputation
0
Spam
0.000
Last Seen
41 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
9 minutes ago
Reputation
0
Spam
0.000