Intl.Locale.prototype.getNumberingSystems()
Intl.Locale 实例的 getNumberingSystems() 方法返回此区域设置的一个或多个唯一 编号系统 标识符的列表。
¥The getNumberingSystems() method of Intl.Locale instances returns a list of one or more unique numbering system identifiers for this locale.
注意:在某些浏览器的某些版本中,此方法被实现为名为
numberingSystems的访问器属性。但是,由于每次访问时都会返回一个新数组,因此现在将其实现为一种方法,以防止出现locale.numberingSystems === locale.numberingSystems返回false的情况。检查 浏览器兼容性表 了解详细信息。¥Note: In some versions of some browsers, this method was implemented as an accessor property called
numberingSystems. However, because it returns a new array on each access, it is now implemented as a method to prevent the situation oflocale.numberingSystems === locale.numberingSystemsreturningfalse. Check the browser compatibility table for details.
语法
参数
返回值
¥Return value
代表 Locale 常用的所有编号系统的字符串数组,按优先级降序排序。如果 Locale 已有 numberingSystem,则返回的数组包含该单个值。
¥An array of strings representing all numbering systems commonly used for the Locale, sorted in descending preference. If the Locale already has a numberingSystem, then the returned array contains that single value.
标准 Unicode 数字系统表如下所示。
¥A table of the standard Unicode numeral systems can be seen below.
支持的编号系统类型
¥Supported numbering system types
| 值 | 描述 |
|---|---|
| adlm | 阿德拉姆数字 |
| ahom | 阿洪数字 |
| arab | 阿拉伯-印度数字 |
| arabext | 扩展阿拉伯-印度数字 |
| armn | 亚美尼亚语大写数字 — 算法 |
| armnlow | 亚美尼亚语小写数字 — 算法 |
| bali | 巴厘岛数字 |
| beng | 孟加拉语数字 |
| bhks | Bhaiksuki 数字 |
| brah | 婆罗米数字 |
| cakm | 查克马数字 |
| cham | 占位数字 |
| cyrl | 西里尔数字 — 算法 |
| deva | 天城文数字 |
| ethi | 埃塞俄比亚数字 — 算法 |
| finance | 财务数字 - 可能是算法的 |
| fullwide | 全角数字 |
| geor | 格鲁吉亚数字 - 算法 |
| gong | Gunjala Gondi 数字 |
| gonm | Masaram Gondi 数字 |
| grek | 希腊大写数字 — 算法 |
| greklow | 希腊小写数字 — 算法 |
| gujr | 古吉拉特语数字 |
| guru | 古尔穆基语数字 |
| hanidays | 农历/其他传统历法的汉字月份日期编号 |
| hanidec | 使用汉字数字表意文字作为数字的位置十进制系统 |
| hans | 简体中文数字 - 算法 |
| hansfin | 简体中文金融数字 - 算法 |
| hant | 繁体中文数字 — 算法 |
| hantfin | 中国传统金融数字 - 算法 |
| hebr | 希伯来数字 - 算法 |
| hmng | Pahawh 苗族数字 |
| hmnp | Nyakeng Puachue 苗族数字 |
| java | Java 数字 |
| jpan | 日语数字 - 算法 |
| jpanfin | 日本金融数字 - 算法 |
| jpanyear | 日本日历的日本元年编号 |
| kali | 克耶黎数字 |
| khmr | 高棉语数字 |
| knda | 卡纳达语数字 |
| lana | Tai Tham Hora(世俗)数字 |
| lanatham | Tai Tham(教会)数字 |
| laoo | 老挝数字 |
| latn | 拉丁数字 |
| lepc | 雷普查数字 |
| limb | 林布数字 |
| mathbold | 数学粗体数字 |
| mathdbl | 数学双击数字 |
| mathmono | 数学等宽数字 |
| mathsanb | 数学无衬线粗体数字 |
| mathsans | 数学无衬线数字 |
| mlym | 马拉雅拉姆语数字 |
| modi | 莫迪数字 |
| mong | 蒙古文数字 |
| mroo | Mro 数字 |
| mtei | 米泰梅耶克数字 |
| mymr | 缅甸数字 |
| mymrshan | 缅甸掸邦数字 |
| mymrtlng | 缅甸泰莱灵数字 |
| native | 母语数字 |
| newa | 纽瓦数字 |
| nkoo | N'Ko 数字 |
| olck | Ol Chiki 数字 |
| orya | 奥里亚语数字 |
| osma | 奥斯曼尼亚数字 |
| rohg | 哈尼菲罗兴亚人数字 |
| roman | 罗马大写数字 — 算法 |
| romanlow | 罗马小写数字 — 算法 |
| saur | 绍拉施特拉数字 |
| shrd | 沙拉达数字 |
| sind | 胡达瓦迪数字 |
| sinh | 僧伽罗语数字 |
| sora | Sora_Sompeng 数字 |
| sund | 巽他语数字 |
| takr | 塔克里数字 |
| talu | 新大略数字 |
| taml | 泰米尔数字 — 算法 |
| tamldec | 现代泰米尔语十进制数字 |
| telu | 泰卢固语数字 |
| thai | 泰语数字 |
| tirh | 提尔胡塔数字 |
| tibt | 藏文数字 |
| traditio | 传统数字 - 可能是算法的 |
| vaii | 瓦伊数字 |
| wara | Warang 花旗数字 |
| wcho | 万乔数字 |
示例
获取支持的编号系统
¥Obtaining supported numbering systems
如果 Locale 对象还没有 numberingSystem,则 getNumberingSystems() 列出给定 Locale 的所有常用编号系统。有关显式设置 numberingSystem 的示例,请参阅 numberingSystem 个例子。
¥If the Locale object doesn't have a numberingSystem already, getNumberingSystems() lists all commonly-used numbering systems for the given Locale. For examples of explicitly setting a numberingSystem, see numberingSystem examples.
const arEG = new Intl.Locale("ar-EG");
console.log(arEG.getNumberingSystems()); // ["arab"]
const ja = new Intl.Locale("ja");
console.log(ja.getNumberingSystems()); // ["latn"]
规范
| Specification |
|---|
| Intl Locale Info Proposal # sec-Intl.Locale.prototype.getNumberingSystems |
浏览器兼容性
BCD tables only load in the browser