Thursday 12 April 2018

Get all the currencies supported in Java

Currency class provides 'getAvailableCurrencies' methods to get all the currencies.
Set<Currency> currencies = Currency.getAvailableCurrencies();

Test.java
package com.sample.test;

import java.util.Currency;
import java.util.Set;

public class Test {

 public static void main(String args[]) throws Exception {
  Set<Currency> currencies = Currency.getAvailableCurrencies();

  System.out.println("Currency Code \t Display Name");
  for (Currency currency : currencies) {
   String currencyCode = currency.getCurrencyCode();
   String displayName = currency.getDisplayName();

   System.out.println(currencyCode + "\t" + displayName);

  }
 }
}


Output
Currency Code   Display Name
ERN Eritrean Nakfa
COP Colombian Peso
CUP Cuban Peso
TJS Tajikistani Somoni
ZWL Zimbabwean Dollar (2009)
GHS Ghanaian Cedi
CHW CHW
BDT Bangladeshi Taka
ZMW ZMW
GYD Guyanaese Dollar
DKK Danish Krone
PYG Paraguayan Guarani
BND Brunei Dollar
XAF CFA Franc BEAC
HNL Honduran Lempira
SZL Swazi Lilangeni
MXN Mexican Peso
NGN Nigerian Naira
SDD Sudanese Dinar (1992-2007)
BMD Bermudan Dollar
TZS Tanzanian Shilling
CHF Swiss Franc
CRC Costa Rican Colón
SYP Syrian Pound
FKP Falkland Islands Pound
PLN Polish Zloty
UYU Uruguayan Peso
ZAR South African Rand
UGX Ugandan Shilling
PTE Portuguese Escudo
ILS Israeli New Sheqel
RUB Russian Ruble
BYR Belarusian Ruble (2000-2016)
XBC European Unit of Account (XBC)
GIP Gibraltar Pound
KZT Kazakhstani Tenge
CYP Cypriot Pound
LKR Sri Lankan Rupee
GEL Georgian Lari
XFU French UIC-Franc
CSD Serbian Dinar (2002-2006)
XAG Silver
KWD Kuwaiti Dinar
RON Romanian Leu
GHC Ghanaian Cedi (1979-2007)
MNT Mongolian Tugrik
SEK Swedish Krona
SAR Saudi Riyal
ANG Netherlands Antillean Guilder
XFO French Gold Franc
XTS Testing Currency Code
MAD Moroccan Dirham
SOS Somali Shilling
RWF Rwandan Franc
ZWN ZWN
INR Indian Rupee
KHR Cambodian Riel
JOD Jordanian Dinar
MGF Malagasy Franc
GMD Gambian Dalasi
VND Vietnamese Dong
UZS Uzbekistan Som
VEF Venezuelan Bolívar
LSL Lesotho Loti
ESP Spanish Peseta
FRF French Franc
NZD New Zealand Dollar
MDL Moldovan Leu
ZWR Zimbabwean Dollar (2008)
QAR Qatari Rial
IRR Iranian Rial
DZD Algerian Dinar
LYD Libyan Dinar
MVR Maldivian Rufiyaa
VUV Vanuatu Vatu
SBD Solomon Islands Dollar
KMF Comorian Franc
ZWD Zimbabwean Dollar (1980-2008)
LAK Laotian Kip
ZMK Zambian Kwacha
CAD Canadian Dollar
AOA Angolan Kwanza
ETB Ethiopian Birr
BRL Brazilian Real
NOK Norwegian Krone
TND Tunisian Dinar
YER Yemeni Rial
MRO Mauritanian Ouguiya
SGD Singapore Dollar
JMD Jamaican Dollar
CDF Congolese Franc
CVE Cape Verdean Escudo
SDG Sudanese Pound
SHP Saint Helena Pound
ISK Icelandic Króna
TRL Turkish Lira (1922-2005)
BEF Belgian Franc
ROL Romanian Leu (1952-2006)
BOB Bolivian Boliviano
GWP Guinea-Bissau Peso
ATS Austrian Schilling
NIO Nicaraguan Córdoba
BGN Bulgarian Lev
ITL Italian Lira
BIF Burundian Franc
BSD Bahamian Dollar
WST Samoan Tala
LRD Liberian Dollar
XXX Unknown Currency
LUF Luxembourgian Franc
MTL Maltese Lira
ARS Argentine Peso
PAB Panamanian Balboa
CLP Chilean Peso
HKD Hong Kong Dollar
HRK Kuna
XOF CFA Franc BCEAO
XDR Special Drawing Rights
USN US Dollar (Next day)
GBP British Pound Sterling
COU COU
TMT Turkmenistani Manat
AFA Afghan Afghani (1927-2002)
FIM Finnish Markka
EEK Estonian Kroon
PEN Peruvian Sol
UAH Ukrainian Hryvnia
TOP Tongan Pa?anga
SIT Slovenian Tolar
SCR Seychellois Rupee
XBB European Monetary Unit
IEP Irish Pound
KGS Kyrgystani Som
USD US Dollar
CLF Chilean Unit of Account (UF)
LVL Latvian Lats
CNY Chinese Yuan
LBP Lebanese Pound
BYB Belarusian Ruble (1994-1999)
AUD Australian Dollar
AZN Azerbaijani Manat
UYI UYI
HUF Hungarian Forint
NPR Nepalese Rupee
XBA European Composite Unit
AWG Aruban Florin
MYR Malaysian Ringgit
AMD Armenian Dram
BWP Botswanan Pula
BZD Belize Dollar
MXV Mexican Investment Unit
XCD East Caribbean Dollar
MGA Malagasy Ariary
SRG Surinamese Guilder
KRW South Korean Won
XAU Gold
RUR Russian Ruble (1991-1998)
ALL Albanian Lek
MKD Macedonian Denar
BTN Bhutanese Ngultrum
AFN Afghan Afghani
TRY Turkish Lira
DJF Djiboutian Franc
PKR Pakistani Rupee
CUC Cuban Convertible Peso
EUR Euro
CHE CHE
XUA ADB Unit of Account
MWK Malawian Malawi Kwacha
XSU Sucre
HTG Haitian Gourde
TTD Trinidad and Tobago Dollar
BBD Barbadian Dollar
XBD European Unit of Account (XBD)
AYM AYM
MZM Mozambican Metical (1980-2006)
SKK Slovak Koruna
KYD Cayman Islands Dollar
BAM Bosnia-Herzegovina Convertible Mark
AED United Arab Emirates Dirham
SVC Salvadoran Colón
OMR Omani Rial
USS US Dollar (Same day)
KPW North Korean Won
MOP Macanese Pataca
ADP Andorran Peseta
EGP Egyptian Pound
GRD Greek Drachma
BOV Bolivian Mvdol
STD São Tomé and Príncipe Dobra
AZM Azerbaijani Manat (1993-2006)
JPY Japanese Yen
SRD Surinamese Dollar
XPD Palladium
TMM Turkmenistani Manat (1993-2009)
XPT Platinum
YUM Yugoslavian New Dinar (1994-2002)
VEB Venezuelan Bolívar (1871-2008)
NAD Namibian Dollar
DOP Dominican Peso
MMK Myanma Kyat
IQD Iraqi Dinar
DEM German Mark
THB Thai Baht
MZN Mozambican Metical
LTL Lithuanian Litas
XPF CFP Franc
MUR Mauritian Rupee
SSP South Sudanese Pound
RSD Serbian Dinar
CZK Czech Republic Koruna
PHP Philippine Peso
PGK Papua New Guinean Kina
BHD Bahraini Dinar
TWD New Taiwan Dollar
NLG Dutch Guilder
GTQ Guatemalan Quetzal
IDR Indonesian Rupiah
SLL Sierra Leonean Leone
BYN Belarusian Ruble
GNF Guinean Franc
KES Kenyan Shilling
TPE Timorese Escudo
BGL Bulgarian Hard Lev
FJD Fijian Dollar



No comments:

Post a Comment