numbro: Problem with Japanese abbreviations.

(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.

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted 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:

Powers of 10 Number English Japanese
1 10 10 10
2 100 100 100
3 1,000 1k 1,000
4 10,000 10k 1万
5 100,000 100k 10万
6 1,000,000 1m 100万
7 10,000,000 10m 1,000万
8 100,000,000 100m 1億
9 1,000,000,000 1b 10億
10 100,000,000,000 100b 100億
12 1,000,000,000,000 1tr 1兆

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.