| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/BigInt/toLocaleString | [Back] [Original] |
Get to know MDN better
toLocaleString() BigInt Intl.NumberFormat API Intl.NumberFormat
toLocaleString Intl.NumberFormat format() NumberFormat format
const bigint = 123456789123456789n;
//
console.log(bigint.toLocaleString("de-DE"));
// : "123.456.789.123.456.789"
//
console.log(
bigint.toLocaleString("de-DE", { style: "currency", currency: "EUR" }),
);
// : "123.456.789.123.456.789,00 "
toLocaleString()
toLocaleString(locales)
toLocaleString(locales, options)
locales options
Intl.NumberFormat API Intl.NumberFormat() Intl.NumberFormat
locales BCP 47 Intl.NumberFormat() locales
Intl.NumberFormat
options Intl.NumberFormat() options
Intl.NumberFormat
Intl.NumberFormat new Intl.NumberFormat(locales, options).format(number)
:
toLocaleString() toLocaleString()
const bigint = 3500n;
console.log(bigint.toLocaleString());
// "3,500" (U.S. English )
API locales options toLocaleString() locales options Intl API
function toLocaleStringSupportsLocales() {
return (
typeof Intl === "object" &&
!!Intl &&
typeof Intl.NumberFormat === "function"
);
}
locale ()
const bigint = 123456789123456789n;
//
console.log(bigint.toLocaleString("de-DE"));
// 123.456.789.123.456.789
//
console.log(bigint.toLocaleString("ar-EG"));
//
// //
console.log(bigint.toLocaleString("en-IN"));
// 1,23,45,67,89,12,34,56,789
// nu
console.log(bigint.toLocaleString("zh-Hans-CN-u-nu-hanidec"));
// ,,,,,
//
//
console.log(bigint.toLocaleString(["ban", "id"]));
// 123.456.789.123.456.789
toLocaleString() options
const bigint = 123456789123456789n;
//
console.log(
bigint.toLocaleString("de-DE", { style: "currency", currency: "EUR" }),
);
// 123.456.789.123.456.789,00
//
console.log(
bigint.toLocaleString("ja-JP", { style: "currency", currency: "JPY" }),
);
// 123,456,789,123,456,789
// 3
console.log(bigint.toLocaleString("en-IN", { maximumSignificantDigits: 3 }));
// 1,23,00,00,00,00,00,00,000
| ECMAScript 2027 Internationalization API Specification # sup-bigint.prototype.tolocalestring |
| Web Proxy Viewer | New URL | Original Page |