| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2017 ..
Intl.NumberFormat .
const number = 123456.789;
console.log(
new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(
number,
),
);
// Expected output: "123.456,79 "
// The Japanese yen doesn't use a minor unit
console.log(
new Intl.NumberFormat("ja-JP", { style: "currency", currency: "JPY" }).format(
number,
),
);
// Expected output: "123,457"
// Limit to three significant digits
console.log(
new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 }).format(
number,
),
);
// Expected output: "1,23,000"
Intl.NumberFormat() NumberFormat.
Intl.NumberFormat.prototype Intl.NumberFormat.
Intl.NumberFormat.prototype.constructor-, . Intl.NumberFormat Intl.NumberFormat.
Intl.NumberFormat.prototype[@@toStringTag] @@toStringTag "Intl.NumberFormat". Object.prototype.toString().
Intl.NumberFormat.prototype.format()Intl.NumberFormat.prototype.formatRange()-, Intl.NumberFormat, .
Intl.NumberFormat.prototype.formatRangeToParts()Intl.NumberFormat.prototype.formatToParts()Intl.NumberFormat.prototype.resolvedOptions(), , .
NumberFormat, .
const number = 3500;
console.log(new Intl.NumberFormat().format(number));
// '3,500' US English
locales . , , , (, , ) locales:
const number = 123456.789;
// , -
console.log(new Intl.NumberFormat("de-DE").format(number));
// 123.456,789
// , -
console.log(new Intl.NumberFormat("ru-RU").format(number));
// 123 456,789
//
console.log(new Intl.NumberFormat("ar-EG").format(number));
//
// //
console.log(new Intl.NumberFormat("en-IN").format(number));
// 1,23,456.789
// nu , ,
console.log(new Intl.NumberFormat("zh-Hans-CN-u-nu-hanidec").format(number));
// ,.
// ,
// , ,
console.log(new Intl.NumberFormat(["ban", "id"]).format(number));
// 123.456,789
options options:
const number = 123456.789;
//
console.log(
new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(
number,
),
);
// 123.456,79
console.log(
new Intl.NumberFormat("ru-RU", { style: "currency", currency: "RUB" }).format(
number,
),
);
// 123 456,79 .
//
console.log(
new Intl.NumberFormat("ja-JP", { style: "currency", currency: "JPY" }).format(
number,
),
);
// 123,457
//
console.log(
new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 }).format(
number,
),
);
// 1,23,000
//
console.log(
new Intl.NumberFormat("pt-PT", {
style: "unit",
unit: "kilometer-per-hour",
}).format(50),
);
// 50 km/h
console.log(
(16).toLocaleString("en-GB", {
style: "unit",
unit: "liter",
unitDisplay: "long",
}),
);
// 16 litres
Intl.NumberFormat() constructor.
| Specification |
|---|
| ECMAScript 2027 Internationalization API Specification # numberformat-objects |
This page was last modified on 17 . 2025 . by MDN contributors.
Intl.NumberFormatObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()IntlIntl.CollatorIntl.DateTimeFormatIntl.DisplayNamesIntl.DurationFormatIntl.ListFormatIntl.LocaleIntl.PluralRulesIntl.RelativeTimeFormatIntl.SegmenterYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |