I want Currency symbol from Currency code. for e.g) EUR -> €, USD -> $, SEK -> kr, DKK -> kr
I am using below code to get currency symbol.
func getSymbolForCurrencyCode(code: String) -> String? {
let locale = NSLocale(localeIdentifier: code)
return locale.displayName(forKey: NSLocale.Key.currencySymbol, value: code)
}
But it returns SEK for SEK and DKK for DKK, it should return kr. For USD, GBP, EUR its working fine.
What could be the issue?