In many programming languages, the thousands separator (e.g., the "," in the American string "1,000") is called the "grouping separator". Why is this?
Are there any real-world locales that separate written integers on some other boundary? Do people somewhere write numbers like 86,75,30,9 or 8675,309? If so, what are those locales?
This issue came up for me today in Objective-C, when I could not remember the name of the constant to find the string for this separator. I was typing "NSThou" and nothing was autocompleting. I had to go to the docs to be reminded that you get it like this:
NSLocale *loc = [NSLocale currentLocale];
NSString *sep = [loc objectForKey:NSLocaleGroupingSeparator];
However, this is not specific to Objective-C; I recall from my old Java days that it was called the same thing. (Python folks, OTOH, seem to call it the "thousands separator".)
Wikipedia says:
For example, in various countries (e.g., China, India, and Japan), there have been traditional conventions of grouping by 2 or 4 digits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With