Intl.Locale.prototype.numberingSystem - JavaScript 编辑

The Intl.Locale.prototype.numberingSystem property is an accessor property that returns the numeral system used by the locale.

Description

A numeral system is a system for expressing numbers. The numberingSystem property helps to represent the different numeral systems used by various countries, regions, and cultures around the world. As with most internationalization schemas, the numeral systems that can be represented in a Locale object by numberingSystem are standardized by Unicode. A table of the standard Unicode numeral systems can be seen below.

ValueDescription
adlmAdlam digits
ahomAhom digits
arabArabic-Indic digits
arabextExtended Arabic-Indic digits
armnArmenian upper case numerals — algorithmic
armnlowArmenian lower case numerals — algorithmic
baliBalinese digits
bengBengali digits
bhksBhaiksuki digits
brahBrahmi digits
cakmChakma digits
chamCham digits
cyrlCyrillic numerals — algorithmic
devaDevanagari digits
ethiEthiopic numerals — algorithmic
financeFinancial numerals — may be algorithmic
fullwideFull width digits
georGeorgian numerals — algorithmic
gongGunjala Gondi digits
gonmMasaram Gondi digits
grekGreek upper case numerals — algorithmic
greklowGreek lower case numerals — algorithmic
gujrGujarati digits
guruGurmukhi digits
hanidaysHan-character day-of-month numbering for lunar/other traditional calendars
hanidecPositional decimal system using Chinese number ideographs as digits
hansSimplified Chinese numerals — algorithmic
hansfinSimplified Chinese financial numerals — algorithmic
hantTraditional Chinese numerals — algorithmic
hantfinTraditional Chinese financial numerals — algorithmic
hebrHebrew numerals — algorithmic
hmngPahawh Hmong digits
hmnpNyiakeng Puachue Hmong digits
javaJavanese digits
jpanJapanese numerals — algorithmic
jpanfinJapanese financial numerals — algorithmic
jpanyearJapanese first-year Gannen numbering for Japanese calendar
kaliKayah Li digits
khmrKhmer digits
kndaKannada digits
lanaTai Tham Hora (secular) digits
lanathamTai Tham Tham (ecclesiastical) digits
laooLao digits
latnLatin digits
lepcLepcha digits
limbLimbu digits
mathboldMathematical bold digits
mathdblMathematical double-struck digits
mathmonoMathematical monospace digits
mathsanbMathematical sans-serif bold digits
mathsansMathematical sans-serif digits
mlymMalayalam digits
modiModi digits
mongMongolian digits
mrooMro digits
mteiMeetei Mayek digits
mymrMyanmar digits
mymrshanMyanmar Shan digits
mymrtlngMyanmar Tai Laing digits
nativeNative digits
newaNewa digits
nkooN'Ko digits
olckOl Chiki digits
oryaOriya digits
osmaOsmanya digits
rohgHanifi Rohingya digits
romanRoman upper case numerals — algorithmic
romanlowRoman lowercase numerals — algorithmic
saurSaurashtra digits
shrdSharada digits
sindKhudawadi digits
sinhSinhala Lith digits
soraSora_Sompeng digits
sundSundanese digits
takrTakri digits
taluNew Tai Lue digits
tamlTamil numerals — algorithmic
tamldecModern Tamil decimal digits
teluTelugu digits
thaiThai digits
tirhTirhuta digits
tibtTibetan digits
traditioTraditional numerals — may be algorithmic
vaiiVai digits
waraWarang Citi digits
wchoWancho digits

Examples

Setting the numberingSystem value via the locale string

In the Unicode locale string spec, the values that numberingSystem represents correspond to the key nu. nu is considered a locale string "extension subtag". These subtags add additional data about the locale, and are added to locale identifiers by first adding the -u key. To set the numberingSystem value via the string argument to the Locale constructor, first add the -u extension key. Next, add the -nu extension key to indicate that you are adding a value for numberingSystem. Finally, add the numberingSystem value to the string.

let numberingSystemViaStr = new Intl.Locale("fr-Latn-FR-u-nu-mong");
console.log(numberingSystemStr.numberingSystem); // Prints "mong"

Setting the numberingSystem value via the configuration object argument

The Intl.Locale constructor has an optional configuration object argument, which can be used to pass extension types. Set the numberingSystem property of the configuration object to your desired numberingSystem value and pass it into the constructor.

let numberingSystemViaObj= new Intl.Locale("en-Latn-US", {numberingSystem: "latn"});
console.log(us12hour.numberingSystem); // Prints "latn"

Specifications

Specification
ECMAScript Internationalization API (ECMA-402)

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:82 次

字数:10536

最后编辑:8 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文