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
28 minutes ago
Reputation
0
Spam
0.000
Last Seen
6 minutes ago
Reputation
0
Spam
0.000
Last Seen
34 minutes ago
Reputation
0
Spam
0.000
Last Seen
21 seconds ago
Reputation
0
Spam
0.000
Last Seen
5 hours ago
Reputation
0
Spam
0.000
Last Seen
27 minutes ago
Reputation
0
Spam
0.000
Last Seen
29 minutes ago
Reputation
0
Spam
0.000
Last Seen
4 minutes ago
Reputation
0
Spam
0.000
Last Seen
5 hours ago
Reputation
0
Spam
0.000
Last Seen
4 hours ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
9 months ago
Reputation
0
Spam
0.000