从货币代码获取货币符号
我想显示一个括号中带有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