Tips & Tutorials

3 Ways To Add Comma To Numbers In Javascript (Thousands Separator)

Welcome to a short tutorial on how to add commas to numbers in Javascript. So you have a project that needs to display some “nice-looking numbers”? The easy ways to add commas to numbers in Javascript are: Use the toLocaleString() function var num = 1234567.89; var commas = num.toLocaleString(“en-US”); Convert the number to a string,

3 Ways To Add Comma To Numbers In Javascript (Thousands Separator) Read More »