我正在用Java编写一些货币转换代码,并使用此API构建货币的内部查找表
final Locale[] locales = Locale.getAvailableLocales();
for (final Locale locale : locales) {
final Currency currency = Currency.getInstance(locale);
String sign = currency.getSymbol(locale)
String code = currency.getCurrencyCode()
/* do something with them */
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,我有两个观察结果.
此列表不会在本机脚本https://en.wikipedia.org/wiki/Indian_rupee_sign中返回卢比标志.它返回Rs.代替
同样对于俄罗斯卢布,它返回руб而不是原生脚本中的卢布符号https://en.wikipedia.org/wiki/Ruble_sign
许多国际货币都有拉丁文和原生文字的标志.Java在返回的内容似乎并不一致.我遇到了限制或我的API使用不正确吗?
谢谢!
| 归档时间: |
|
| 查看次数: |
291 次 |
| 最近记录: |