Search code examples
swiftlocalecurrency

Get currency name from Locale swift


Is there any way to get a currency name from the current Locale in swift? I'm not talking about the identifier or symbol (so not the "USD" or "$"). I'm looking for something like "American Dollars". Is that built in to swift or do I have to make my own list?


Solution

  • The functionality is accessible on Locale:

    let locale = Locale.current
    print(locale.localizedString(forCurrencyCode: "USD")) // Optional("US Dollar")