Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the thousands separator called the "grouping separator"?

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".)

like image 554
Mason Avatar asked Sep 14 '25 06:09

Mason


1 Answers

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.

like image 187
Carl Norum Avatar answered Sep 15 '25 19:09

Carl Norum