The syntax of the toLocaleString() method is:
num.toLocaleString(locales, options)
Here, num is a number.
toLocaleString() Parameters
The toLocaleString() method takes in:
- locales (Optional) - A string specifying which language specific format to use.
- options (Optional) - An object with configuration properties.
To learn more, visit Intl.NumberFormat() constructor.
Return value from toLocaleString()
- Returns a string with a language-sensitive representation of the given number.
Example: Using toLocaleString() method
Output
400,000 1,23,456.789 123.000 €
Recommended Reading: