ES6 - toLocaleString()



This method converts a number object into a human readable string representing the number using the locale of the environment.

Syntax

number.toLocaleString()

Return value

Returns a human readable string representing the number using the locale of the environment.

Example

var num = new Number(177.1234);
console.log( num.toLocaleString());

Output

177.1234
Advertisements