This method available to numbers will convert the number into a string which is suitable for presentation in the given locale.
Method of Number | |
|---|---|
| Implemented in | JavaScript ? |
| ECMAScript Edition | ECMAScript ? Edition |
Syntax
number.toLocaleString()
Examples
var number = 3500 console.log(number.toLocaleString()); /* Displays "3,500" in English locale */