On this page
  1. Intl.NumberFormat
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Intl.NumberFormat

Prev: Intl | Up: Intl | Next: DateTimeFormat
Rel: Intl, String, RegExp & Intl Guide
Ref: MDN Web Docs — Intl.NumberFormat
Tags: #public #web #javascript #builtins #intl #tier/core


Signature & Overview

new Intl.NumberFormat(locales?, options?)

Formats numbers, percentages, currencies, and compact units (1.2K) per locale.

Notes & Pitfalls

Example

const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });
console.assert(usd.format(1234.5) === "$1,234.50");

Linked from

Related notes