문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top