How to make this number "1234567890" into "1,234,567,890"?

So a whole number to separate by commas, so I can format it to look like that? Important thing is for it go from last digit, so in this case "0", and every 3 digt to plant a comma.
2 Replies
Jochem
Jochem3d ago
MDN Web Docs
Number.prototype.toLocaleString() - JavaScript | MDN
The toLocaleString() method of Number values returns a string with a language-sensitive representation of this number. In implementations with Intl.NumberFormat API support, this method simply calls Intl.NumberFormat.
Dovah
Dovah3d ago
Worked perfectly! Thanks!