Last active
February 13, 2021 02:04
-
-
Save roz0n/ebc867b535de445f7b7ebc585a25e1f4 to your computer and use it in GitHub Desktop.
Combine ExchangeRate API currency codes, ISO codes, and full country names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ExchangeRate API Supported Currencies | |
const currencies = { | |
"AED": { | |
"FIELD2": "UAE Dirham", | |
"FIELD3": "United Arab Emirates" | |
}, | |
"AFN": { | |
"FIELD2": "Afghan Afghani", | |
"FIELD3": "Afghanistan" | |
}, | |
"ALL": { | |
"FIELD2": "Albanian Lek", | |
"FIELD3": "Albania" | |
}, | |
"AMD": { | |
"FIELD2": "Armenian Dram", | |
"FIELD3": "Armenia" | |
}, | |
"ANG": { | |
"FIELD2": "Netherlands Antillian Guilder", | |
"FIELD3": "Netherlands Antilles" | |
}, | |
"AOA": { | |
"FIELD2": "Angolan Kwanza", | |
"FIELD3": "Angola" | |
}, | |
"ARS": { | |
"FIELD2": "Argentine Peso", | |
"FIELD3": "Argentina" | |
}, | |
"AUD": { | |
"FIELD2": "Australian Dollar", | |
"FIELD3": "Australia" | |
}, | |
"AWG": { | |
"FIELD2": "Aruban Florin", | |
"FIELD3": "Aruba" | |
}, | |
"AZN": { | |
"FIELD2": "Azerbaijani Manat", | |
"FIELD3": "Azerbaijan" | |
}, | |
"BAM": { | |
"FIELD2": "Bosnia and Herzegovina Mark", | |
"FIELD3": "Bosnia and Herzegovina" | |
}, | |
"BBD": { | |
"FIELD2": "Barbados Dollar", | |
"FIELD3": "Barbados" | |
}, | |
"BDT": { | |
"FIELD2": "Bangladeshi Taka", | |
"FIELD3": "Bangladesh" | |
}, | |
"BGN": { | |
"FIELD2": "Bulgarian Lev", | |
"FIELD3": "Bulgaria" | |
}, | |
"BHD": { | |
"FIELD2": "Bahraini Dinar", | |
"FIELD3": "Bahrain" | |
}, | |
"BIF": { | |
"FIELD2": "Burundian Franc", | |
"FIELD3": "Burundi" | |
}, | |
"BMD": { | |
"FIELD2": "Bermudian Dollar", | |
"FIELD3": "Bermuda" | |
}, | |
"BND": { | |
"FIELD2": "Brunei Dollar", | |
"FIELD3": "Brunei" | |
}, | |
"BOB": { | |
"FIELD2": "Bolivian Boliviano", | |
"FIELD3": "Bolivia" | |
}, | |
"BRL": { | |
"FIELD2": "Brazilian Real", | |
"FIELD3": "Brazil" | |
}, | |
"BSD": { | |
"FIELD2": "Bahamian Dollar", | |
"FIELD3": "Bahamas" | |
}, | |
"BTN": { | |
"FIELD2": "Bhutanese Ngultrum", | |
"FIELD3": "Bhutan" | |
}, | |
"BWP": { | |
"FIELD2": "Botswana Pula", | |
"FIELD3": "Botswana" | |
}, | |
"BYN": { | |
"FIELD2": "Belarusian Ruble", | |
"FIELD3": "Belarus" | |
}, | |
"BZD": { | |
"FIELD2": "Belize Dollar", | |
"FIELD3": "Belize" | |
}, | |
"CAD": { | |
"FIELD2": "Canadian Dollar", | |
"FIELD3": "Canada" | |
}, | |
"CDF": { | |
"FIELD2": "Congolese Franc", | |
"FIELD3": "Democratic Republic of the Congo" | |
}, | |
"CHF": { | |
"FIELD2": "Swiss Franc", | |
"FIELD3": "Switzerland" | |
}, | |
"CLP": { | |
"FIELD2": "Chilean Peso", | |
"FIELD3": "Chile" | |
}, | |
"CNY": { | |
"FIELD2": "Chinese Renminbi", | |
"FIELD3": "China" | |
}, | |
"COP": { | |
"FIELD2": "Colombian Peso", | |
"FIELD3": "Colombia" | |
}, | |
"CRC": { | |
"FIELD2": "Costa Rican Colon", | |
"FIELD3": "Costa Rica" | |
}, | |
"CUC": { | |
"FIELD2": "Cuban Convertible Peso", | |
"FIELD3": "Cuba" | |
}, | |
"CUP": { | |
"FIELD2": "Cuban Peso", | |
"FIELD3": "Cuba" | |
}, | |
"CVE": { | |
"FIELD2": "Cape Verdean Escudo", | |
"FIELD3": "Cape Verde" | |
}, | |
"CZK": { | |
"FIELD2": "Czech Koruna", | |
"FIELD3": "Czech Republic" | |
}, | |
"DJF": { | |
"FIELD2": "Djiboutian Franc", | |
"FIELD3": "Djibouti" | |
}, | |
"DKK": { | |
"FIELD2": "Danish Krone", | |
"FIELD3": "Denmark" | |
}, | |
"DOP": { | |
"FIELD2": "Dominican Peso", | |
"FIELD3": "Dominican Republic" | |
}, | |
"DZD": { | |
"FIELD2": "Algerian Dinar", | |
"FIELD3": "Algeria" | |
}, | |
"EGP": { | |
"FIELD2": "Egyptian Pound", | |
"FIELD3": "Egypt" | |
}, | |
"ERN": { | |
"FIELD2": "Eritrean Nakfa", | |
"FIELD3": "Eritrea" | |
}, | |
"ETB": { | |
"FIELD2": "Ethiopian Birr", | |
"FIELD3": "Ethiopia" | |
}, | |
"EUR": { | |
"FIELD2": "Euro", | |
"FIELD3": "European Union" | |
}, | |
"FJD": { | |
"FIELD2": "Fiji Dollar", | |
"FIELD3": "Fiji" | |
}, | |
"FKP": { | |
"FIELD2": "Falkland Islands Pound", | |
"FIELD3": "Falkland Islands" | |
}, | |
"FOK": { | |
"FIELD2": "Faroese Króna", | |
"FIELD3": "Faroe Islands" | |
}, | |
"GBP": { | |
"FIELD2": "Pound Sterling", | |
"FIELD3": "United Kingdom" | |
}, | |
"GEL": { | |
"FIELD2": "Georgian Lari", | |
"FIELD3": "Georgia" | |
}, | |
"GGP": { | |
"FIELD2": "Guernsey Pound", | |
"FIELD3": "Guernsey" | |
}, | |
"GHS": { | |
"FIELD2": "Ghanaian Cedi", | |
"FIELD3": "Ghana" | |
}, | |
"GIP": { | |
"FIELD2": "Gibraltar Pound", | |
"FIELD3": "Gibraltar" | |
}, | |
"GMD": { | |
"FIELD2": "Gambian Dalasi", | |
"FIELD3": "The Gambia" | |
}, | |
"GNF": { | |
"FIELD2": "Guinean Franc", | |
"FIELD3": "Guinea" | |
}, | |
"GTQ": { | |
"FIELD2": "Guatemalan Quetzal", | |
"FIELD3": "Guatemala" | |
}, | |
"GYD": { | |
"FIELD2": "Guyanese Dollar", | |
"FIELD3": "Guyana" | |
}, | |
"HKD": { | |
"FIELD2": "Hong Kong Dollar", | |
"FIELD3": "Hong Kong" | |
}, | |
"HNL": { | |
"FIELD2": "Honduran Lempira", | |
"FIELD3": "Honduras" | |
}, | |
"HRK": { | |
"FIELD2": "Croatian Kuna", | |
"FIELD3": "Croatia" | |
}, | |
"HTG": { | |
"FIELD2": "Haitian Gourde", | |
"FIELD3": "Haiti" | |
}, | |
"HUF": { | |
"FIELD2": "Hungarian Forint", | |
"FIELD3": "Hungary" | |
}, | |
"IDR": { | |
"FIELD2": "Indonesian Rupiah", | |
"FIELD3": "Indonesia" | |
}, | |
"ILS": { | |
"FIELD2": "Israeli New Shekel", | |
"FIELD3": "Israel" | |
}, | |
"IMP": { | |
"FIELD2": "Manx Pound", | |
"FIELD3": "Isle of Man" | |
}, | |
"INR": { | |
"FIELD2": "Indian Rupee", | |
"FIELD3": "India" | |
}, | |
"IQD": { | |
"FIELD2": "Iraqi Dinar", | |
"FIELD3": "Iraq" | |
}, | |
"IRR": { | |
"FIELD2": "Iranian Rial", | |
"FIELD3": "Iran" | |
}, | |
"ISK": { | |
"FIELD2": "Icelandic Króna", | |
"FIELD3": "Iceland" | |
}, | |
"JMD": { | |
"FIELD2": "Jamaican Dollar", | |
"FIELD3": "Jamaica" | |
}, | |
"JOD": { | |
"FIELD2": "Jordanian Dinar", | |
"FIELD3": "Jordan" | |
}, | |
"JPY": { | |
"FIELD2": "Japanese Yen", | |
"FIELD3": "Japan" | |
}, | |
"KES": { | |
"FIELD2": "Kenyan Shilling", | |
"FIELD3": "Kenya" | |
}, | |
"KGS": { | |
"FIELD2": "Kyrgyzstani Som", | |
"FIELD3": "Kyrgyzstan" | |
}, | |
"KHR": { | |
"FIELD2": "Cambodian Riel", | |
"FIELD3": "Cambodia" | |
}, | |
"KID": { | |
"FIELD2": "Kiribati Dollar", | |
"FIELD3": "Kiribati" | |
}, | |
"KMF": { | |
"FIELD2": "Comorian Franc", | |
"FIELD3": "Comoros" | |
}, | |
"KRW": { | |
"FIELD2": "South Korean Won", | |
"FIELD3": "South Korea" | |
}, | |
"KWD": { | |
"FIELD2": "Kuwaiti Dinar", | |
"FIELD3": "Kuwait" | |
}, | |
"KYD": { | |
"FIELD2": "Cayman Islands Dollar", | |
"FIELD3": "Cayman Islands" | |
}, | |
"KZT": { | |
"FIELD2": "Kazakhstani Tenge", | |
"FIELD3": "Kazakhstan" | |
}, | |
"LAK": { | |
"FIELD2": "Lao Kip", | |
"FIELD3": "Laos" | |
}, | |
"LBP": { | |
"FIELD2": "Lebanese Pound", | |
"FIELD3": "Lebanon" | |
}, | |
"LKR": { | |
"FIELD2": "Sri Lanka Rupee", | |
"FIELD3": "Sri Lanka" | |
}, | |
"LRD": { | |
"FIELD2": "Liberian Dollar", | |
"FIELD3": "Liberia" | |
}, | |
"LSL": { | |
"FIELD2": "Lesotho Loti", | |
"FIELD3": "Lesotho" | |
}, | |
"LYD": { | |
"FIELD2": "Libyan Dinar", | |
"FIELD3": "Libya" | |
}, | |
"MAD": { | |
"FIELD2": "Moroccan Dirham", | |
"FIELD3": "Morocco" | |
}, | |
"MDL": { | |
"FIELD2": "Moldovan Leu", | |
"FIELD3": "Moldova" | |
}, | |
"MGA": { | |
"FIELD2": "Malagasy Ariary", | |
"FIELD3": "Madagascar" | |
}, | |
"MKD": { | |
"FIELD2": "Macedonian Denar", | |
"FIELD3": "North Macedonia" | |
}, | |
"MMK": { | |
"FIELD2": "Burmese Kyat", | |
"FIELD3": "Myanmar" | |
}, | |
"MNT": { | |
"FIELD2": "Mongolian Tögrög", | |
"FIELD3": "Mongolia" | |
}, | |
"MOP": { | |
"FIELD2": "Macanese Pataca", | |
"FIELD3": "Macau" | |
}, | |
"MRU": { | |
"FIELD2": "Mauritanian Ouguiya", | |
"FIELD3": "Mauritania" | |
}, | |
"MUR": { | |
"FIELD2": "Mauritian Rupee", | |
"FIELD3": "Mauritius" | |
}, | |
"MVR": { | |
"FIELD2": "Maldivian Rufiyaa", | |
"FIELD3": "Maldives" | |
}, | |
"MWK": { | |
"FIELD2": "Malawian Kwacha", | |
"FIELD3": "Malawi" | |
}, | |
"MXN": { | |
"FIELD2": "Mexican Peso", | |
"FIELD3": "Mexico" | |
}, | |
"MYR": { | |
"FIELD2": "Malaysian Ringgit", | |
"FIELD3": "Malaysia" | |
}, | |
"MZN": { | |
"FIELD2": "Mozambican Metical", | |
"FIELD3": "Mozambique" | |
}, | |
"NAD": { | |
"FIELD2": "Namibian Dollar", | |
"FIELD3": "Namibia" | |
}, | |
"NGN": { | |
"FIELD2": "Nigerian Naira", | |
"FIELD3": "Nigeria" | |
}, | |
"NIO": { | |
"FIELD2": "Nicaraguan Córdoba", | |
"FIELD3": "Nicaragua" | |
}, | |
"NOK": { | |
"FIELD2": "Norwegian Krone", | |
"FIELD3": "Norway" | |
}, | |
"NPR": { | |
"FIELD2": "Nepalese Rupee", | |
"FIELD3": "Nepal" | |
}, | |
"NZD": { | |
"FIELD2": "New Zealand Dollar", | |
"FIELD3": "New Zealand" | |
}, | |
"OMR": { | |
"FIELD2": "Omani Rial", | |
"FIELD3": "Oman" | |
}, | |
"PAB": { | |
"FIELD2": "Panamanian Balboa", | |
"FIELD3": "Panama" | |
}, | |
"PEN": { | |
"FIELD2": "Peruvian Sol", | |
"FIELD3": "Peru" | |
}, | |
"PGK": { | |
"FIELD2": "Papua New Guinean Kina", | |
"FIELD3": "Papua New Guinea" | |
}, | |
"PHP": { | |
"FIELD2": "Philippine Peso", | |
"FIELD3": "Philippines" | |
}, | |
"PKR": { | |
"FIELD2": "Pakistani Rupee", | |
"FIELD3": "Pakistan" | |
}, | |
"PLN": { | |
"FIELD2": "Polish Złoty", | |
"FIELD3": "Poland" | |
}, | |
"PYG": { | |
"FIELD2": "Paraguayan Guaraní", | |
"FIELD3": "Paraguay" | |
}, | |
"QAR": { | |
"FIELD2": "Qatari Riyal", | |
"FIELD3": "Qatar" | |
}, | |
"RON": { | |
"FIELD2": "Romanian Leu", | |
"FIELD3": "Romania" | |
}, | |
"RSD": { | |
"FIELD2": "Serbian Dinar", | |
"FIELD3": "Serbia" | |
}, | |
"RUB": { | |
"FIELD2": "Russian Ruble", | |
"FIELD3": "Russia" | |
}, | |
"RWF": { | |
"FIELD2": "Rwandan Franc", | |
"FIELD3": "Rwanda" | |
}, | |
"SAR": { | |
"FIELD2": "Saudi Riyal", | |
"FIELD3": "Saudi Arabia" | |
}, | |
"SBD": { | |
"FIELD2": "Solomon Islands Dollar", | |
"FIELD3": "Solomon Islands" | |
}, | |
"SCR": { | |
"FIELD2": "Seychellois Rupee", | |
"FIELD3": "Seychelles" | |
}, | |
"SDG": { | |
"FIELD2": "Sudanese Pound", | |
"FIELD3": "Sudan" | |
}, | |
"SEK": { | |
"FIELD2": "Swedish Krona", | |
"FIELD3": "Sweden" | |
}, | |
"SGD": { | |
"FIELD2": "Singapore Dollar", | |
"FIELD3": "Singapore" | |
}, | |
"SHP": { | |
"FIELD2": "Saint Helena Pound", | |
"FIELD3": "Saint Helena" | |
}, | |
"SLL": { | |
"FIELD2": "Sierra Leonean Leone", | |
"FIELD3": "Sierra Leone" | |
}, | |
"SOS": { | |
"FIELD2": "Somali Shilling", | |
"FIELD3": "Somalia" | |
}, | |
"SRD": { | |
"FIELD2": "Surinamese Dollar", | |
"FIELD3": "Suriname" | |
}, | |
"SSP": { | |
"FIELD2": "South Sudanese Pound", | |
"FIELD3": "South Sudan" | |
}, | |
"STN": { | |
"FIELD2": "São Tomé and Príncipe Dobra", | |
"FIELD3": "São Tomé and Príncipe" | |
}, | |
"SYP": { | |
"FIELD2": "Syrian Pound", | |
"FIELD3": "Syria" | |
}, | |
"SZL": { | |
"FIELD2": "Eswatini Lilangeni", | |
"FIELD3": "Eswatini" | |
}, | |
"THB": { | |
"FIELD2": "Thai Baht", | |
"FIELD3": "Thailand" | |
}, | |
"TJS": { | |
"FIELD2": "Tajikistani Somoni", | |
"FIELD3": "Tajikistan" | |
}, | |
"TMT": { | |
"FIELD2": "Turkmenistan Manat", | |
"FIELD3": "Turkmenistan" | |
}, | |
"TND": { | |
"FIELD2": "Tunisian Dinar", | |
"FIELD3": "Tunisia" | |
}, | |
"TOP": { | |
"FIELD2": "Tongan Paʻanga", | |
"FIELD3": "Tonga" | |
}, | |
"TRY": { | |
"FIELD2": "Turkish Lira", | |
"FIELD3": "Turkey" | |
}, | |
"TTD": { | |
"FIELD2": "Trinidad and Tobago Dollar", | |
"FIELD3": "Trinidad and Tobago" | |
}, | |
"TVD": { | |
"FIELD2": "Tuvaluan Dollar", | |
"FIELD3": "Tuvalu" | |
}, | |
"TWD": { | |
"FIELD2": "New Taiwan Dollar", | |
"FIELD3": "Taiwan" | |
}, | |
"TZS": { | |
"FIELD2": "Tanzanian Shilling", | |
"FIELD3": "Tanzania" | |
}, | |
"UAH": { | |
"FIELD2": "Ukrainian Hryvnia", | |
"FIELD3": "Ukraine" | |
}, | |
"UGX": { | |
"FIELD2": "Ugandan Shilling", | |
"FIELD3": "Uganda" | |
}, | |
"USD": { | |
"FIELD2": "United States Dollar", | |
"FIELD3": "United States" | |
}, | |
"UYU": { | |
"FIELD2": "Uruguayan Peso", | |
"FIELD3": "Uruguay" | |
}, | |
"UZS": { | |
"FIELD2": "Uzbekistani So'm", | |
"FIELD3": "Uzbekistan" | |
}, | |
"VES": { | |
"FIELD2": "Venezuelan Bolívar Soberano", | |
"FIELD3": "Venezuela" | |
}, | |
"VND": { | |
"FIELD2": "Vietnamese Đồng", | |
"FIELD3": "Vietnam" | |
}, | |
"VUV": { | |
"FIELD2": "Vanuatu Vatu", | |
"FIELD3": "Vanuatu" | |
}, | |
"WST": { | |
"FIELD2": "Samoan Tālā", | |
"FIELD3": "Samoa" | |
}, | |
"XAF": { | |
"FIELD2": "Central African CFA Franc", | |
"FIELD3": "CEMAC" | |
}, | |
"XCD": { | |
"FIELD2": "East Caribbean Dollar", | |
"FIELD3": "Organisation of Eastern Caribbean States" | |
}, | |
"XDR": { | |
"FIELD2": "Special Drawing Rights", | |
"FIELD3": "International Monetary Fund" | |
}, | |
"XOF": { | |
"FIELD2": "West African CFA franc", | |
"FIELD3": "CFA" | |
}, | |
"XPF": { | |
"FIELD2": "CFP Franc", | |
"FIELD3": "Collectivités d'Outre-Mer" | |
}, | |
"YER": { | |
"FIELD2": "Yemeni Rial", | |
"FIELD3": "Yemen" | |
}, | |
"ZAR": { | |
"FIELD2": "South African Rand", | |
"FIELD3": "South Africa" | |
}, | |
"ZMW": { | |
"FIELD2": "Zambian Kwacha", | |
"FIELD3": "Zambia" | |
} | |
} | |
// ISO 3166-1 Country Codes | |
const countries = { | |
"AF": "Afghanistan", | |
"AX": "Aland Islands", | |
"AL": "Albania", | |
"DZ": "Algeria", | |
"AS": "American Samoa", | |
"AD": "Andorra", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctica", | |
"AG": "Antigua And Barbuda", | |
"AR": "Argentina", | |
"AM": "Armenia", | |
"AW": "Aruba", | |
"AU": "Australia", | |
"AT": "Austria", | |
"AZ": "Azerbaijan", | |
"BS": "Bahamas", | |
"BH": "Bahrain", | |
"BD": "Bangladesh", | |
"BB": "Barbados", | |
"BY": "Belarus", | |
"BE": "Belgium", | |
"BZ": "Belize", | |
"BJ": "Benin", | |
"BM": "Bermuda", | |
"BT": "Bhutan", | |
"BO": "Bolivia", | |
"BA": "Bosnia And Herzegovina", | |
"BW": "Botswana", | |
"BV": "Bouvet Island", | |
"BR": "Brazil", | |
"IO": "British Indian Ocean Territory", | |
"BN": "Brunei Darussalam", | |
"BG": "Bulgaria", | |
"BF": "Burkina Faso", | |
"BI": "Burundi", | |
"KH": "Cambodia", | |
"CM": "Cameroon", | |
"CA": "Canada", | |
"CV": "Cape Verde", | |
"KY": "Cayman Islands", | |
"CF": "Central African Republic", | |
"TD": "Chad", | |
"CL": "Chile", | |
"CN": "China", | |
"CX": "Christmas Island", | |
"CC": "Cocos (Keeling) Islands", | |
"CO": "Colombia", | |
"KM": "Comoros", | |
"CG": "Congo", | |
"CD": "Congo, Democratic Republic", | |
"CK": "Cook Islands", | |
"CR": "Costa Rica", | |
"CI": "Cote D\"Ivoire", | |
"HR": "Croatia", | |
"CU": "Cuba", | |
"CY": "Cyprus", | |
"CZ": "Czech Republic", | |
"DK": "Denmark", | |
"DJ": "Djibouti", | |
"DM": "Dominica", | |
"DO": "Dominican Republic", | |
"EC": "Ecuador", | |
"EG": "Egypt", | |
"SV": "El Salvador", | |
"GQ": "Equatorial Guinea", | |
"ER": "Eritrea", | |
"EE": "Estonia", | |
"ET": "Ethiopia", | |
"FK": "Falkland Islands (Malvinas)", | |
"FO": "Faroe Islands", | |
"FJ": "Fiji", | |
"FI": "Finland", | |
"FR": "France", | |
"GF": "French Guiana", | |
"PF": "French Polynesia", | |
"TF": "French Southern Territories", | |
"GA": "Gabon", | |
"GM": "Gambia", | |
"GE": "Georgia", | |
"DE": "Germany", | |
"GH": "Ghana", | |
"GI": "Gibraltar", | |
"GR": "Greece", | |
"GL": "Greenland", | |
"GD": "Grenada", | |
"GP": "Guadeloupe", | |
"GU": "Guam", | |
"GT": "Guatemala", | |
"GG": "Guernsey", | |
"GN": "Guinea", | |
"GW": "Guinea-Bissau", | |
"GY": "Guyana", | |
"HT": "Haiti", | |
"HM": "Heard Island & Mcdonald Islands", | |
"VA": "Holy See (Vatican City State)", | |
"HN": "Honduras", | |
"HK": "Hong Kong", | |
"HU": "Hungary", | |
"IS": "Iceland", | |
"IN": "India", | |
"ID": "Indonesia", | |
"IR": "Iran, Islamic Republic Of", | |
"IQ": "Iraq", | |
"IE": "Ireland", | |
"IM": "Isle Of Man", | |
"IL": "Israel", | |
"IT": "Italy", | |
"JM": "Jamaica", | |
"JP": "Japan", | |
"JE": "Jersey", | |
"JO": "Jordan", | |
"KZ": "Kazakhstan", | |
"KE": "Kenya", | |
"KI": "Kiribati", | |
"KR": "Korea", | |
"KP": "North Korea", | |
"KW": "Kuwait", | |
"KG": "Kyrgyzstan", | |
"LA": "Lao People\"s Democratic Republic", | |
"LV": "Latvia", | |
"LB": "Lebanon", | |
"LS": "Lesotho", | |
"LR": "Liberia", | |
"LY": "Libyan Arab Jamahiriya", | |
"LI": "Liechtenstein", | |
"LT": "Lithuania", | |
"LU": "Luxembourg", | |
"MO": "Macao", | |
"MK": "Macedonia", | |
"MG": "Madagascar", | |
"MW": "Malawi", | |
"MY": "Malaysia", | |
"MV": "Maldives", | |
"ML": "Mali", | |
"MT": "Malta", | |
"MH": "Marshall Islands", | |
"MQ": "Martinique", | |
"MR": "Mauritania", | |
"MU": "Mauritius", | |
"YT": "Mayotte", | |
"MX": "Mexico", | |
"FM": "Micronesia, Federated States Of", | |
"MD": "Moldova", | |
"MC": "Monaco", | |
"MN": "Mongolia", | |
"ME": "Montenegro", | |
"MS": "Montserrat", | |
"MA": "Morocco", | |
"MZ": "Mozambique", | |
"MM": "Myanmar", | |
"NA": "Namibia", | |
"NR": "Nauru", | |
"NP": "Nepal", | |
"NL": "Netherlands", | |
"AN": "Netherlands Antilles", | |
"NC": "New Caledonia", | |
"NZ": "New Zealand", | |
"NI": "Nicaragua", | |
"NE": "Niger", | |
"NG": "Nigeria", | |
"NU": "Niue", | |
"NF": "Norfolk Island", | |
"MP": "Northern Mariana Islands", | |
"NO": "Norway", | |
"OM": "Oman", | |
"PK": "Pakistan", | |
"PW": "Palau", | |
"PS": "Palestinian Territory, Occupied", | |
"PA": "Panama", | |
"PG": "Papua New Guinea", | |
"PY": "Paraguay", | |
"PE": "Peru", | |
"PH": "Philippines", | |
"PN": "Pitcairn", | |
"PL": "Poland", | |
"PT": "Portugal", | |
"PR": "Puerto Rico", | |
"QA": "Qatar", | |
"RE": "Reunion", | |
"RO": "Romania", | |
"RU": "Russian Federation", | |
"RW": "Rwanda", | |
"BL": "Saint Barthelemy", | |
"SH": "Saint Helena", | |
"KN": "Saint Kitts And Nevis", | |
"LC": "Saint Lucia", | |
"MF": "Saint Martin", | |
"PM": "Saint Pierre And Miquelon", | |
"VC": "Saint Vincent And Grenadines", | |
"WS": "Samoa", | |
"SM": "San Marino", | |
"ST": "Sao Tome And Principe", | |
"SA": "Saudi Arabia", | |
"SN": "Senegal", | |
"RS": "Serbia", | |
"SC": "Seychelles", | |
"SL": "Sierra Leone", | |
"SG": "Singapore", | |
"SK": "Slovakia", | |
"SI": "Slovenia", | |
"SB": "Solomon Islands", | |
"SO": "Somalia", | |
"ZA": "South Africa", | |
"GS": "South Georgia And Sandwich Isl.", | |
"ES": "Spain", | |
"LK": "Sri Lanka", | |
"SD": "Sudan", | |
"SR": "Suriname", | |
"SJ": "Svalbard And Jan Mayen", | |
"SZ": "Swaziland", | |
"SE": "Sweden", | |
"CH": "Switzerland", | |
"SY": "Syrian Arab Republic", | |
"TW": "Taiwan", | |
"TJ": "Tajikistan", | |
"TZ": "Tanzania", | |
"TH": "Thailand", | |
"TL": "Timor-Leste", | |
"TG": "Togo", | |
"TK": "Tokelau", | |
"TO": "Tonga", | |
"TT": "Trinidad And Tobago", | |
"TN": "Tunisia", | |
"TR": "Turkey", | |
"TM": "Turkmenistan", | |
"TC": "Turks And Caicos Islands", | |
"TV": "Tuvalu", | |
"UG": "Uganda", | |
"UA": "Ukraine", | |
"AE": "United Arab Emirates", | |
"GB": "United Kingdom", | |
"US": "United States", | |
"UM": "United States Outlying Islands", | |
"UY": "Uruguay", | |
"UZ": "Uzbekistan", | |
"VU": "Vanuatu", | |
"VE": "Venezuela", | |
"VN": "Vietnam", | |
"VG": "Virgin Islands, British", | |
"VI": "Virgin Islands, U.S.", | |
"WF": "Wallis And Futuna", | |
"EH": "Western Sahara", | |
"YE": "Yemen", | |
"ZM": "Zambia", | |
"ZW": "Zimbabwe" | |
} | |
// Currency Symbols | |
const syms = [ | |
{ | |
"currency": "Albania Lek", | |
"abbreviation": "ALL", | |
"symbol": "Lek" | |
}, | |
{ | |
"currency": "Afghanistan Afghani", | |
"abbreviation": "AFN", | |
"symbol": "؋" | |
}, | |
{ | |
"currency": "Argentina Peso", | |
"abbreviation": "ARS", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Aruba Guilder", | |
"abbreviation": "AWG", | |
"symbol": "ƒ" | |
}, | |
{ | |
"currency": "Australia Dollar", | |
"abbreviation": "AUD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Azerbaijan New Manat", | |
"abbreviation": "AZN", | |
"symbol": "ман" | |
}, | |
{ | |
"currency": "Bahamas Dollar", | |
"abbreviation": "BSD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Barbados Dollar", | |
"abbreviation": "BBD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Belarus Ruble", | |
"abbreviation": "BYR", | |
"symbol": "p." | |
}, | |
{ | |
"currency": "Belize Dollar", | |
"abbreviation": "BZD", | |
"symbol": "BZ$" | |
}, | |
{ | |
"currency": "Bermuda Dollar", | |
"abbreviation": "BMD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Bolivia Boliviano", | |
"abbreviation": "BOB", | |
"symbol": "$b" | |
}, | |
{ | |
"currency": "Bosnia and Herzegovina Convertible Marka", | |
"abbreviation": "BAM", | |
"symbol": "KM" | |
}, | |
{ | |
"currency": "Botswana Pula", | |
"abbreviation": "BWP", | |
"symbol": "P" | |
}, | |
{ | |
"currency": "Bulgaria Lev", | |
"abbreviation": "BGN", | |
"symbol": "лв" | |
}, | |
{ | |
"currency": "Brazil Real", | |
"abbreviation": "BRL", | |
"symbol": "R$" | |
}, | |
{ | |
"currency": "Brunei Darussalam Dollar", | |
"abbreviation": "BND", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Cambodia Riel", | |
"abbreviation": "KHR", | |
"symbol": "៛" | |
}, | |
{ | |
"currency": "Canada Dollar", | |
"abbreviation": "CAD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Cayman Islands Dollar", | |
"abbreviation": "KYD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Chile Peso", | |
"abbreviation": "CLP", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "China Yuan Renminbi", | |
"abbreviation": "CNY", | |
"symbol": "¥" | |
}, | |
{ | |
"currency": "Colombia Peso", | |
"abbreviation": "COP", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Costa Rica Colon", | |
"abbreviation": "CRC", | |
"symbol": "₡" | |
}, | |
{ | |
"currency": "Croatia Kuna", | |
"abbreviation": "HRK", | |
"symbol": "kn" | |
}, | |
{ | |
"currency": "Cuba Peso", | |
"abbreviation": "CUP", | |
"symbol": "₱" | |
}, | |
{ | |
"currency": "Czech Republic Koruna", | |
"abbreviation": "CZK", | |
"symbol": "Kč" | |
}, | |
{ | |
"currency": "Denmark Krone", | |
"abbreviation": "DKK", | |
"symbol": "kr" | |
}, | |
{ | |
"currency": "Dominican Republic Peso", | |
"abbreviation": "DOP", | |
"symbol": "RD$" | |
}, | |
{ | |
"currency": "East Caribbean Dollar", | |
"abbreviation": "XCD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Egypt Pound", | |
"abbreviation": "EGP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "El Salvador Colon", | |
"abbreviation": "SVC", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Estonia Kroon", | |
"abbreviation": "EEK", | |
"symbol": "kr" | |
}, | |
{ | |
"currency": "Euro Member Countries", | |
"abbreviation": "EUR", | |
"symbol": "€" | |
}, | |
{ | |
"currency": "Falkland Islands (Malvinas) Pound", | |
"abbreviation": "FKP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Fiji Dollar", | |
"abbreviation": "FJD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Ghana Cedis", | |
"abbreviation": "GHC", | |
"symbol": "¢" | |
}, | |
{ | |
"currency": "Gibraltar Pound", | |
"abbreviation": "GIP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Guatemala Quetzal", | |
"abbreviation": "GTQ", | |
"symbol": "Q" | |
}, | |
{ | |
"currency": "Guernsey Pound", | |
"abbreviation": "GGP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Guyana Dollar", | |
"abbreviation": "GYD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Honduras Lempira", | |
"abbreviation": "HNL", | |
"symbol": "L" | |
}, | |
{ | |
"currency": "Hong Kong Dollar", | |
"abbreviation": "HKD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Hungary Forint", | |
"abbreviation": "HUF", | |
"symbol": "Ft" | |
}, | |
{ | |
"currency": "Iceland Krona", | |
"abbreviation": "ISK", | |
"symbol": "kr" | |
}, | |
{ | |
"currency": "India Rupee", | |
"abbreviation": "INR", | |
"symbol": null | |
}, | |
{ | |
"currency": "Indonesia Rupiah", | |
"abbreviation": "IDR", | |
"symbol": "Rp" | |
}, | |
{ | |
"currency": "Iran Rial", | |
"abbreviation": "IRR", | |
"symbol": "﷼" | |
}, | |
{ | |
"currency": "Isle of Man Pound", | |
"abbreviation": "IMP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Israel Shekel", | |
"abbreviation": "ILS", | |
"symbol": "₪" | |
}, | |
{ | |
"currency": "Jamaica Dollar", | |
"abbreviation": "JMD", | |
"symbol": "J$" | |
}, | |
{ | |
"currency": "Japan Yen", | |
"abbreviation": "JPY", | |
"symbol": "¥" | |
}, | |
{ | |
"currency": "Jersey Pound", | |
"abbreviation": "JEP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Kazakhstan Tenge", | |
"abbreviation": "KZT", | |
"symbol": "лв" | |
}, | |
{ | |
"currency": "Korea (North) Won", | |
"abbreviation": "KPW", | |
"symbol": "₩" | |
}, | |
{ | |
"currency": "Korea (South) Won", | |
"abbreviation": "KRW", | |
"symbol": "₩" | |
}, | |
{ | |
"currency": "Kyrgyzstan Som", | |
"abbreviation": "KGS", | |
"symbol": "лв" | |
}, | |
{ | |
"currency": "Laos Kip", | |
"abbreviation": "LAK", | |
"symbol": "₭" | |
}, | |
{ | |
"currency": "Latvia Lat", | |
"abbreviation": "LVL", | |
"symbol": "Ls" | |
}, | |
{ | |
"currency": "Lebanon Pound", | |
"abbreviation": "LBP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Liberia Dollar", | |
"abbreviation": "LRD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Lithuania Litas", | |
"abbreviation": "LTL", | |
"symbol": "Lt" | |
}, | |
{ | |
"currency": "Macedonia Denar", | |
"abbreviation": "MKD", | |
"symbol": "ден" | |
}, | |
{ | |
"currency": "Malaysia Ringgit", | |
"abbreviation": "MYR", | |
"symbol": "RM" | |
}, | |
{ | |
"currency": "Mauritius Rupee", | |
"abbreviation": "MUR", | |
"symbol": "₨" | |
}, | |
{ | |
"currency": "Mexico Peso", | |
"abbreviation": "MXN", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Mongolia Tughrik", | |
"abbreviation": "MNT", | |
"symbol": "₮" | |
}, | |
{ | |
"currency": "Mozambique Metical", | |
"abbreviation": "MZN", | |
"symbol": "MT" | |
}, | |
{ | |
"currency": "Namibia Dollar", | |
"abbreviation": "NAD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Nepal Rupee", | |
"abbreviation": "NPR", | |
"symbol": "₨" | |
}, | |
{ | |
"currency": "Netherlands Antilles Guilder", | |
"abbreviation": "ANG", | |
"symbol": "ƒ" | |
}, | |
{ | |
"currency": "New Zealand Dollar", | |
"abbreviation": "NZD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Nicaragua Cordoba", | |
"abbreviation": "NIO", | |
"symbol": "C$" | |
}, | |
{ | |
"currency": "Nigeria Naira", | |
"abbreviation": "NGN", | |
"symbol": "₦" | |
}, | |
{ | |
"currency": "Korea (North) Won", | |
"abbreviation": "KPW", | |
"symbol": "₩" | |
}, | |
{ | |
"currency": "Norway Krone", | |
"abbreviation": "NOK", | |
"symbol": "kr" | |
}, | |
{ | |
"currency": "Oman Rial", | |
"abbreviation": "OMR", | |
"symbol": "﷼" | |
}, | |
{ | |
"currency": "Pakistan Rupee", | |
"abbreviation": "PKR", | |
"symbol": "₨" | |
}, | |
{ | |
"currency": "Panama Balboa", | |
"abbreviation": "PAB", | |
"symbol": "B/." | |
}, | |
{ | |
"currency": "Paraguay Guarani", | |
"abbreviation": "PYG", | |
"symbol": "Gs" | |
}, | |
{ | |
"currency": "Peru Nuevo Sol", | |
"abbreviation": "PEN", | |
"symbol": "S/." | |
}, | |
{ | |
"currency": "Philippines Peso", | |
"abbreviation": "PHP", | |
"symbol": "₱" | |
}, | |
{ | |
"currency": "Poland Zloty", | |
"abbreviation": "PLN", | |
"symbol": "zł" | |
}, | |
{ | |
"currency": "Qatar Riyal", | |
"abbreviation": "QAR", | |
"symbol": "﷼" | |
}, | |
{ | |
"currency": "Romania New Leu", | |
"abbreviation": "RON", | |
"symbol": "lei" | |
}, | |
{ | |
"currency": "Russia Ruble", | |
"abbreviation": "RUB", | |
"symbol": "руб" | |
}, | |
{ | |
"currency": "Saint Helena Pound", | |
"abbreviation": "SHP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Saudi Arabia Riyal", | |
"abbreviation": "SAR", | |
"symbol": "﷼" | |
}, | |
{ | |
"currency": "Serbia Dinar", | |
"abbreviation": "RSD", | |
"symbol": "Дин." | |
}, | |
{ | |
"currency": "Seychelles Rupee", | |
"abbreviation": "SCR", | |
"symbol": "₨" | |
}, | |
{ | |
"currency": "Singapore Dollar", | |
"abbreviation": "SGD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Solomon Islands Dollar", | |
"abbreviation": "SBD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Somalia Shilling", | |
"abbreviation": "SOS", | |
"symbol": "S" | |
}, | |
{ | |
"currency": "South Africa Rand", | |
"abbreviation": "ZAR", | |
"symbol": "R" | |
}, | |
{ | |
"currency": "Korea (South) Won", | |
"abbreviation": "KRW", | |
"symbol": "₩" | |
}, | |
{ | |
"currency": "Sri Lanka Rupee", | |
"abbreviation": "LKR", | |
"symbol": "₨" | |
}, | |
{ | |
"currency": "Sweden Krona", | |
"abbreviation": "SEK", | |
"symbol": "kr" | |
}, | |
{ | |
"currency": "Switzerland Franc", | |
"abbreviation": "CHF", | |
"symbol": "CHF" | |
}, | |
{ | |
"currency": "Suriname Dollar", | |
"abbreviation": "SRD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Syria Pound", | |
"abbreviation": "SYP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "Taiwan New Dollar", | |
"abbreviation": "TWD", | |
"symbol": "NT$" | |
}, | |
{ | |
"currency": "Thailand Baht", | |
"abbreviation": "THB", | |
"symbol": "฿" | |
}, | |
{ | |
"currency": "Trinidad and Tobago Dollar", | |
"abbreviation": "TTD", | |
"symbol": "TT$" | |
}, | |
{ | |
"currency": "Turkey Lira", | |
"abbreviation": "TRY", | |
"symbol": null | |
}, | |
{ | |
"currency": "Turkey Lira", | |
"abbreviation": "TRL", | |
"symbol": "₤" | |
}, | |
{ | |
"currency": "Tuvalu Dollar", | |
"abbreviation": "TVD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Ukraine Hryvna", | |
"abbreviation": "UAH", | |
"symbol": "₴" | |
}, | |
{ | |
"currency": "United Kingdom Pound", | |
"abbreviation": "GBP", | |
"symbol": "£" | |
}, | |
{ | |
"currency": "United States Dollar", | |
"abbreviation": "USD", | |
"symbol": "$" | |
}, | |
{ | |
"currency": "Uruguay Peso", | |
"abbreviation": "UYU", | |
"symbol": "$U" | |
}, | |
{ | |
"currency": "Uzbekistan Som", | |
"abbreviation": "UZS", | |
"symbol": "лв" | |
}, | |
{ | |
"currency": "Venezuela Bolivar", | |
"abbreviation": "VEF", | |
"symbol": "Bs" | |
}, | |
{ | |
"currency": "Viet Nam Dong", | |
"abbreviation": "VND", | |
"symbol": "₫" | |
}, | |
{ | |
"currency": "Yemen Rial", | |
"abbreviation": "YER", | |
"symbol": "﷼" | |
}, | |
{ | |
"currency": "Zimbabwe Dollar", | |
"abbreviation": "ZWD", | |
"symbol": "Z$" | |
} | |
] | |
function main(currencies = {}, countries = {}, symbols = []) { | |
const output = [] | |
function getCountryCode(codes, name) { | |
let code = "" | |
Object.keys(codes).forEach((el) => { | |
let x = codes[el].toLowerCase() | |
let y = name.toLowerCase() | |
if (x == y) code = codes[el] | |
}) | |
return code | |
} | |
function getSymbol(symbols, currency) { | |
let symbol = "" | |
symbols.map((el) => { | |
let x = el.abbreviation | |
let y = currency | |
if (x == y) symbol = el.symbol | |
}) | |
return symbol | |
} | |
(function getCurrencyCodes(codes = {}) { | |
Object.keys(codes).forEach((el) => { | |
let current = {} | |
current["iso4217"] = el | |
current["iso3166-1"] = getCountryCode(countries, currencies[el]["FIELD3"]) | |
current["currencyName"] = currencies[el]["FIELD2"] | |
current["countryName"] = currencies[el]["FIELD3"] | |
current["symbol"] = getSymbol(symbols, el) | |
output.push(current) | |
}) | |
})(currencies) | |
return output | |
} | |
console.log(main(currencies, countries, syms)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment