Problem with Japanese abbreviations.
See original GitHub issue(moved from foretagsplatsen/Numeral-js/issues/9)
I’ve already reported this issue here adamwdraper/Numeral-js/issues/248, but as the original branch is not maintained anymore, I think it would be better to focus on your branch.
Now, Numeral.js is grouping numbers into 4 groups: thousands, milions, billions and trillions.
But, in case of Japanese (and I suppose it also applies to Chinese) numbers are grouped in slightly different way: every hundred, thousand and ten thousand.
100 -> 1百
1,000 -> 1千
10,000 -> 1万
100,000 -> 10万
1,000,000 -> 1百万
10,000,000 -> 1千万
100,000,000 -> 1億
Before I start fixing this issue, I’d like to discuss how to approach that problem. Ideas:
- add more abbreviations in library core
- let languages define their own formatting/unformatting functions
Sample formatting function here: http://jsfiddle.net/tuknLbz8/1/
Anyway, I think we need more flexible architecture if we want to support even more complicated numeral systems like Indian numbering system.
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (8 by maintainers)
Top GitHub Comments
@BenjaminVanRyseghem I would like to helping with this issue. But I think OP is not how a large numeric should be display.
Let’s see what it should be look like:
This is more reasonable and I think is easier to implement. Since the only different of these two system is how we separate large number (that means, >= 1,000), the problem of “百” or “1百” doesn’t exist. Japanese numeric system (which is the same as Chinese), are based on 10^4, while western system are based on 10^3.
I have found this web page might help: https://www.trussel.com/jnumbers.htm
When the OP mentions we should write “100” as “百”, it just like saying we should write “1 hundred” in English, doesn’t make sense. Because it is how we read the number, not how we write them.
@ArmorDarks I would like to keep locales out of the format string