JavaScript - toFixed() Number Object

Last Updated Jul 29, 2015, 07:00:14 PM





The JavaScript toLocaleString() method returns a string with a language sensitive representation of this number

This method handles converting a number object into a string representing the number using the locale of the environment.


Syntax

The following example explains how to use method toLocaleString() i.e., num.toLocaleString(893.3424). Will convert number object into string.



Example

Try It Now



Other JavaScript Number Object Methods you might want to learn

toString()

valueOf()

toExponential()

toFixed()




Sources and Credits

The source of the content has been referred and updated with Mozilla Developer Network and W3C Organization

Last Updated Jul 29, 2015, 07:00:14 PM





Browser compatibility

Feature
toLocaleString() Yes Yes Yes Yes Yes Yes Yes