从货币代码获取货币符号 [英] Getting Currency Symbol from Currency Code

查看:117
本文介绍了从货币代码获取货币符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个括号中带有ISO和货币符号的货币列表,例如USD($)或GBP(£)。该列表应该是动态的,因此对其进行硬编码是不可能的,因为用户可以选择要在列表中看到的货币。我已经能够显示ISO值,但是我也想要符号。

I want to display a list of currencies that would have the ISO and the currency symbol in brackets i.e. something like USD($) or GBP(£). The list is supposed to be dynamic, so hard-coding it is out of the question because the user gets to choose what kind of currencies they get to see in the list. I've been able to get the ISO values to show up, but I want the symbols too.

是否存在可以将 USD转换为 $的Web服务或某个类?

Is there a webservice or some class that can convert 'USD' to '$'?

推荐答案

仅知道每次都击中Web服务的货币符号不是一个好主意。
第三方Web服务提供商可能会在没有通知的情况下进行服务器维护,因此在这种情况下您的应用程序将无法正常工作。

Just to know about currency symbols hitting the webservice each time is not a good idea. It could be possible third party webservice provider can go to server maintenance without informing and in this situation your application will not work.

如果可以下载则更好货币符号对照ISO代码,在服务器启动时创建它的HashMap并从中获取相关值。

Its better if you can download the currency symbol against ISO code, create HashMap of it at server start up time and fetch the related value from it.

下面是可从其中下载FinalCurrency的链接.xls。
https://drive.google.com/file/d/0B5DVIZeIMrCQMGRYT3NFd05CSGM/edit

Below is the link from where you can download the FinalCurrency.xls. https://drive.google.com/file/d/0B5DVIZeIMrCQMGRYT3NFd05CSGM/edit

这篇关于从货币代码获取货币符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆