【问题标题】:How to convert currency symbol to Currency Code in iOS?如何在 iOS 中将货币符号转换为货币代码?
【发布时间】:2014-10-10 20:41:36
【问题描述】:

我需要在我的 iOS 应用中将“$”或“RM”等货币符号转换为“USD”和“MYR”等货币代码。

【问题讨论】:

  • 不存在 1-1 反向映射 - 请参阅 this xe reference,因此不会产生一致的结果。

标签: ios objective-c currency


【解决方案1】:

您可以使用NSNumberFormatter

货币值字符串仍将根据用户的语言环境进行格式化

[numberFormatter setCurrencyCode:@"USD"];

【讨论】:

    猜你喜欢
    • 2014-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-04
    • 2014-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多