Question

I have an app in which I let the user add products and set a price for them. Now I want to let the user choose the currency for these prices. How do I do that? I mean, should I make a custom list of all currencies, then associate these with a proper locale, which I then can send to NSNumberFormatter, or is there some better way?

Was it helpful?

Solution

Depending on what you want to display to users, creating your own configuration could be best. You can also query NSLocale to get the availableLocaleIdentifiers which you could display (or use to filter your custom list to locales the system understands). Setting the locale of the number formatted is much better and more reliable than trying to specify your own formats.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top