Perhaps in any browser or any environment such as NodeJS? The closest I can get to is:
console.log((10000).toLocaleString("zh-u-nu-hanidec"))
"一〇,〇〇〇"
inside of Chrome or Firefox. (The result being looked for is 一萬
or 一万
, with the first form traditional Chinese character, and the second form simplified Chinese character). I am not sure what the u
is for zh-u
, maybe it is for unicode and it needs to put in front of nu
for number system. Also I wonder why it has to be this form but
(10000).toLocaleString("zh", {numberingSystem: "hanidec"})
would give "10,000"
.
The first line output really is just converting 1
to 一
, which is just a one to one mapping of digit characters. The way 10000
is spoken or written should be 一萬
or 一万
. There is a 10000
unit. So for 1000
, it is 一千
, meaning "One(一) Thousand(千)", but for 10000
, it is not written or spoken as "Ten Thousand" but as "One(一) Wàn(萬)", with Wàn
meaning 10,000.
I read into MDN and ECMA-402 but can't find the relevant info yet.