The toLocaleString() method returns a string value version of the current number in a format that may vary according to a browser's local settings.
Example
You can try to run the following code to return a string value version −
<html> <head> <title>JavaScript toLocaleString() Method </title> </head> <body> <script> var num = new Number(150.1234); document.write( num.toLocaleString()); </script> </body> </html>