local decimal = string.match(string.format("%.1f",1/5),"([^0-9])")
local thousands = decimal=="." and "," or "."
Localization-free.
That's not that simple. Though getting a comprehensive list of thousand/decimal separator is quite hard (or I failed at google skill), there is at least three characters involved : dot, comma and space. And usage and norms sometimes differ. Moreover, in some language, digits were grouped by 2 or 4, not 3. There is some background information about this on wikipedia : http://en.wikipedia.org/wiki/Decimal_separator
That's not that simple. Though getting a comprehensive list of thousand/decimal separator is quite hard (or I failed at google skill), there is at least three characters involved : dot, comma and space. And usage and norms sometimes differ. Moreover, in some language, digits were grouped by 2 or 4, not 3. There is some background information about this on wikipedia : http://en.wikipedia.org/wiki/Decimal_separator
I didn't see anything in that article that says a ',' or '.' convention isn't recognized by all the official locales supported in WoW.
So unless WoW moves to using artificial, historic, handwriting or polite form conventions
this works quite good for all intents and purposes.
Not in french : 1000 millions = 1 milliard. But I dont't know how it is shorten, I guess we rather use kilo-, Mega-, Giga-, Tera- and so on. Also, a lowercase 'm' means 10^-3. 10^6 would be M.
I'm sure I can find a file somewhere later about localization of mill and billion, but would the m actually be confusing? I will probably not worry about billions until I see a mob that has so much.
I guess it woudn't be too much confusing in this particular context, but it could easily be, look at these translations in french :
- "thousand" is "mille" (but in Wow every one uses 'k' for kilo-)
- "million" is "million"
- "billion" is "milliard" (as you said, no mob has that much HP yet)
An uppercase M (for Mega-) would be more adequate in french. Or go with the scientific notation : 10^6 ! ^^
The "100k" and "1.2m" used by many addons to abbreviate large number values are based on the International System of Units. Indeed, its common abbreviation "SI" comes from the French, so it shouldn't be confusing at all. :p
Look at the table in your link : 'm' stands for "milli-" while 'M' stands for "mega-".
'm' is also the metre unit and the letter used for mass, now it gets really confusing :p
I didn't see anything in that article that says a ',' or '.' convention isn't recognized by all the official locales supported in WoW.
So unless WoW moves to using artificial, historic, handwriting or polite form conventions
this works quite good for all intents and purposes.
Look at the thousand separator: "," in english, "." in german, " " in french. By the way, the International System of Units recommends using a (thin) space for thousand separator in any case, to avoid any confusion.
Of course, this is probably dependent on what fonts are available at the time :-\
edit: clarification - none of the four base WoW client fonts have large character sets and even if there's no visible glyph, it would still have to be defined. Windows and Mac (and I assume Linux) have systems in place to borrow characters from other fonts to fill out Unicode ranges, but I have no idea whether the WoW client hooks into this system or not ... test first :-)
edit: addendum - tried it out and the "thin space" is a no-go :-\ (the escape sequence above prints a zero-width question mark)
On the other hand, most people playing with UIs are running their fonts at such small sizes that a normal space would probably work just as well, legibility wise ...
No worry Ketho, I do it all the time. ;)
That's not that simple. Though getting a comprehensive list of thousand/decimal separator is quite hard (or I failed at google skill), there is at least three characters involved : dot, comma and space. And usage and norms sometimes differ. Moreover, in some language, digits were grouped by 2 or 4, not 3. There is some background information about this on wikipedia : http://en.wikipedia.org/wiki/Decimal_separator
Not in french : 1000 millions = 1 milliard. But I dont't know how it is shorten, I guess we rather use kilo-, Mega-, Giga-, Tera- and so on.
Also, a lowercase 'm' means 10^-3. 10^6 would be M.
I didn't see anything in that article that says a ',' or '.' convention isn't recognized by all the official locales supported in WoW.
So unless WoW moves to using artificial, historic, handwriting or polite form conventions
this works quite good for all intents and purposes.
I'm sure I can find a file somewhere later about localization of mill and billion, but would the m actually be confusing? I will probably not worry about billions until I see a mob that has so much.
- "thousand" is "mille" (but in Wow every one uses 'k' for kilo-)
- "million" is "million"
- "billion" is "milliard" (as you said, no mob has that much HP yet)
An uppercase M (for Mega-) would be more adequate in french. Or go with the scientific notation : 10^6 ! ^^
'm' is also the metre unit and the letter used for mass, now it gets really confusing :p
Look at the thousand separator: "," in english, "." in german, " " in french. By the way, the International System of Units recommends using a (thin) space for thousand separator in any case, to avoid any confusion.
Case matters ! "M" ~= "m" !
Ok, actually, context also does matter. In the context of mob health points, 65x10^-3 wouldn't make much sense.
Looks like the simplest acceptable (if not always correct) compromise would be:
The WoW client allows decimal escaped Unicode sequences:
U+2009 "THIN SPACE" ==> \226\128\137
Of course, this is probably dependent on what fonts are available at the time :-\
edit: clarification - none of the four base WoW client fonts have large character sets and even if there's no visible glyph, it would still have to be defined. Windows and Mac (and I assume Linux) have systems in place to borrow characters from other fonts to fill out Unicode ranges, but I have no idea whether the WoW client hooks into this system or not ... test first :-)
edit: addendum - tried it out and the "thin space" is a no-go :-\ (the escape sequence above prints a zero-width question mark)
On the other hand, most people playing with UIs are running their fonts at such small sizes that a normal space would probably work just as well, legibility wise ...