Number.toLocaleString

Table of Contents

  1. Summary
  2. Syntax
  3. Examples
  4. See also

Summary

This method available to numbers will convert the number into a string which is suitable for presentation in the given locale.

Method of Number
Implemented in JavaScript 1.5
ECMAScript Edition ECMAScript 3rd Edition

Syntax

number.toLocaleString()

Examples

var number = 3500;

console.log(number.toLocaleString()); /* Displays "3,500" in English locale */

See also

Tags (2)

Contributors to this page: evilpie, ethertank, Sevenspade, aseville, Brettz9
Last updated by: ethertank,
Last reviewed by: ethertank,