In iOS I’d like to perform some specific functions if the user’s [NSLocale currentLocale] does not use Arabic Numerals (i.e. not 0123456789). How can I check for this condition?
In iOS I’d like to perform some specific functions if the user’s [NSLocale currentLocale]
Share
Unfortunately there is no direct attribute to check, but the following code will check it:
The check is done via a set of the digits (nSet) against the locale aware formatter of the current locale (numFmt). The value is used to format a number of all digits, which could be reduced to less digits than 1 to 0. However this might serve as an example of other detections as well.
Please note that using a separator or thousand grouping character will not break the detection because superset is being used.