I came across this post, Format Number like Stack Overflow (rounded to thousands with K suffix), that explains how to take a number and apply a suffix to the end so that large numbers are shortened and takes up less space while retaining the meaning. SO uses the same basic logic in various places.
I'd like to use similar logic but I noticed that this solution is partially English specific. The suffixes are a mix of English letters (m = million, b = billion) and a metric symbol (k) and I'm wondering how this could be re-written so that it is localizable for other languages.
For example in the post it formats numbers like this:
1.1k = 1,100 thousand. this uses the k metric kilo symbol to denote thousands.
1.4m = 1,400,000 million. this uses the letter m from the English word million to denote millions.
1.6b = 1,600,000,000 billion. this uses the letter b from the English word billion to denote billions.
My questions are:
1) Are metric symbols like k, M, and G recognizable by all cultures? (wikipedia suggests it is for everyone except the US but I have my doubts)
2) Is there something in the .Net BCL that I can use to grab the appropriate single or multi-letter combination for any given language to denote millions and billions like this is currently doing in English?
I thought about just using all metric symbols but G doesn't register as billions for me because I'm from the US ;)
1.1k
1.4M
1.6G
If metric symbols are universally recognized outside of the US then perhaps the above is appropriate for everyone and the US is the only special snowflake which makes this a simple if/else statement.
Fingers crossed that people who speak and write in non-English languages can chime on this.