toLocaleString formats numbers according to a given locale

2018-10-15

For example, this:

(3500).toLocaleString()

will return 3,500 if using the US English locale.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString