Get All Possible Available Currencies

前端 未结 8 1669
忘了有多久
忘了有多久 2021-02-05 09:17

I would like to get all possible available currencies.

Java 7 had provided such feature.

public static Set java.util.Currency.g         


        
8条回答
  •  遥遥无期
    2021-02-05 09:31

    I am using the Currency java class but I was not able to find the Currency of Afghanistan (AFN), so I was not sure if I could rely on this Currency Library. To fix this I am using the joda-money library.

    So I put in my pom.xml this:

    org.joda joda-money 0.11

    And in my code I use this:

    List currencyUnits = CurrencyUnit.registeredCurrencies();

    to get all Currencies, and the AFN was there so I am using this library now.

    I hope it can help.

提交回复
热议问题