toLocaleString

Table of contents

  1. 1. Syntax
  2. 2. Examples
  3. 3. See Also
Table of contents
  1. 1. Syntax
  2. 2. Examples
  3. 3. See Also

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 ?
ECMAScript Edition ECMAScript ? Edition

Syntax

number.toLocaleString()

Examples

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

Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file