With NSNumberFormatter it is very easy to format a number using a fixed string as GroupingSeparator.
[numberFormatter setGroupingSeparator:@"."];
But in some countries @”.” is not the valid separator: @”,” (a comma) is instead. How can I get a localized grouping separator from the system so my formatting is correct all around the world in any language?
You can use
setLocale::The locale exposes the correct symbols for things like decimal separator, quotation marks, and units of measurement and currency.
However! Beware of using this for currency; there is no automatic value conversion. If you have a number representing some amount of U.S. dollars, and just format it as if it were euros, it will be formatted correctly, but will not have the correct meaning.