Number.localeFormat Function

Formats a number by using the current culture.

var a = numberVar.localeFormat(format);


A format string.

A string that contains the formatted number value.

Exception type



format is invalid.

Use the localeFormat method to get a string representation of the Number object values that are based on the format parameter. The localeFormat method provides the number based on a specific culture value (locale). The culture value is also used to display information for specific language and country combinations.

For more information about cultures and locales, see ASP.NET Globalization and Localization and the CultureInfo documentation. For more information about date and time string formats, see Sys.CultureInfo Class.