toLocaleString()  Number  instance method JS Home  <<  JS Reference  <<  Number  <<  toLocaleString()

Description

Returns a string representation of the number using locale specific notation.

This method overrides the toLocaleString() method of Object.

Syntax

Signature Description
aNumber.toLocaleString()Returns a string representation of the number using locale specific notation.

Parameters

None.

Examples

The code below displays some numerical values in default locale.


// Locale strings.
var aNumber = 1612345;
var bNumber = 1612345.234567;

alert(aNumber.toLocaleString());
alert(bNumber.toLocaleString());

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 3 - Number

JavaScript Basics

JavaScript Basics

JavaScript Intermediate

JavaScript Intermediate

JavaScript Advanced

JavaScript Advanced

JavaScript Reference

JavaScript Entities

Globals

Number

MIN_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
prototype
Instance Properties
constructor
Class Methods
None.
Instance Methods Getters
toExponential()
toFixed()
toLocaleString()
toPrecision()
toString()
valueOf()
Instance Methods Setters
None.

Statements

Operators