java - convert iso 4217 numeric currency code to currency name -


I have ISO 4217 numeric currency code: 840

I want to get the currency name: USD < / P>

I am trying to:

currency curr1 = currency .get instances ("840");

But how do I fix java.lang.IllegalArgumentException

? Any ideas?

java.util.Currency.getInstance only supports ISO 4217 Currency Code No, currency numbers, however, you can retrieve all the currencies by using the getAvailableCurrencies method, and then the result of the getNumericCode method By comparison, you can search for code 840.

Like it:

  Public Stable Currency Matchinance (Int Numericcode) {Set < Currency & gt; Currencies = currency.gateAlways (); (Currency currency: currencies) {if (currency.getNumericCode () == numeric code} {return currency; }} New invalid invalid takedown exception ("numeral code plus currency" + numeric code + "not found"); }  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -