Monday, March 7, 2016

Java Example : How To Get All The Currency Code

Examples


package com.freesamplecode.java.currency;

import java.util.Currency;
import java.util.Locale;

public class GetAllCurrencyCodeDemo {
 public static void main(String[] args){
  Locale[] locales = Locale.getAvailableLocales();
  
  for(Locale locale :locales){
   
   if(!locale.getDisplayCountry().equals("")){
    System.out.println(locale.getDisplayCountry() + " : "+Currency.getInstance(locale).getCurrencyCode());
   }
   
  }
  
 }
}

Output


Malaysia : MYR
Qatar : QAR
Iceland : ISK
Finland : EUR
Malta : EUR
Switzerland : CHF
Belgium : EUR
Saudi Arabia : SAR
Iraq : IQD
Puerto Rico : USD
Chile : CLP
Austria : EUR
United Kingdom : GBP
Panama : PAB
Yemen : YER
Macedonia : MKD
Canada : CAD
Vietnam : VND
Netherlands : EUR
United States : USD
China : CNY
Honduras : HNL
United States : USD
Morocco : MAD
Indonesia : IDR
South Africa : ZAR
South Korea : KRW
Tunisia : TND
Serbia : RSD
Belarus : BYR
Taiwan : TWD
Sudan : SDG
Japan : JPY
Bolivia : BOB
Algeria : DZD
Argentina : ARS
United Arab Emirates : AED
Canada : CAD
Lithuania : LTL
Montenegro : EUR
Syria : SYP
Russia : RUB
Belgium : EUR
Spain : EUR
Israel : ILS
Denmark : DKK
Costa Rica : CRC
Hong Kong : HKD
Spain : EUR
Thailand : THB
Ukraine : UAH
Dominican Republic : DOP
Venezuela : VEF
Poland : PLN
Libya : LYD
Jordan : JOD
Hungary : HUF
Guatemala : GTQ
Paraguay : PYG
Bulgaria : BGN
Croatia : HRK
Bosnia and Herzegovina : BAM
Romania : RON
Luxembourg : EUR
Singapore : SGD
Ecuador : USD
Bosnia and Herzegovina : BAM
Nicaragua : NIO
El Salvador : SVC
India : INR
Greece : EUR
Slovenia : EUR
Italy : EUR
Japan : JPY
Luxembourg : EUR
Switzerland : CHF
Malta : EUR
Bahrain : BHD
Montenegro : EUR
Brazil : BRL
Norway : NOK
Switzerland : CHF
Singapore : SGD
Kuwait : KWD
Egypt : EGP
Ireland : EUR
Peru : PEN
Czech Republic : CZK
Turkey : TRY
Uruguay : UYU
Ireland : EUR
India : INR
Oman : OMR
Serbia and Montenegro : CSD
Albania : ALL
Portugal : EUR
Latvia : LVL
Serbia : RSD
Slovakia : EUR
Mexico : MXN
Australia : AUD
Norway : NOK
New Zealand : NZD
Sweden : SEK
Lebanon : LBP
Germany : EUR
Thailand : THB
Colombia : COP
Philippines : PHP
Estonia : EUR
Cyprus : EUR
France : EUR


0 comments: