Last active
April 27, 2017 18:11
-
-
Save panoply/1da8820fd9bd6950f64c4dcab12c96c3 to your computer and use it in GitHub Desktop.
Relative Country ISO to Currency
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
/** | |
* Relative ISO to Currency JSON. | |
* This is custom list of countries that are relative to brixtol.com | |
*/ | |
var geo = { | |
"locals": [ | |
{ | |
"country": "US", | |
"name": "US Dollar", | |
"curreny": "USD" | |
}, | |
{ | |
"country": "CA", | |
"name": "Canadian Dollar", | |
"code": "CAD" | |
}, | |
{ | |
"country": "AE", | |
"name": "United Arab Emirates Dirham", | |
"currency": "AED" | |
}, | |
{ | |
"country": "AT", | |
"name": "Austria (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "AU", | |
"name": "Australian Dollar", | |
"currency": "AUD" | |
}, | |
{ | |
"country": "BE", | |
"name": "Belgium (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "CH", | |
"name": "Swiss Franc", | |
"currency": "CHF" | |
}, | |
{ | |
"country": "CN", | |
"name": "Chinese Yuan", | |
"currency": "CNY" | |
}, | |
{ | |
"country": "CY", | |
"name": "Cyprus (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "CZ", | |
"name": "Czech Republic Koruna", | |
"currency": "CZK" | |
}, | |
{ | |
"country": "DE", | |
"name": "Deutschland (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "DK", | |
"name": "Danish Krone", | |
"currency": "DKK" | |
}, | |
{ | |
"country": "EL", | |
"name": "Greece (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "ES", | |
"name": "Spain (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "FI", | |
"name": "Finland (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "FR", | |
"name": "France (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "GB", | |
"name": "British Pound Sterling", | |
"currency": "GBP" | |
}, | |
{ | |
"country": "HK", | |
"name": "Hong Kong Dollar", | |
"currency": "HKD" | |
}, | |
{ | |
"country": "HR", | |
"name": "Croatia (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "IE", | |
"name": "Ireland (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "IS", | |
"name": "Icelandic Króna", | |
"currency": "ISK" | |
}, | |
{ | |
"country": "IT", | |
"name": "Italy (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "JP", | |
"name": "Japanese Yen", | |
"currency": "JPY" | |
}, | |
{ | |
"country": "KR", | |
"name": "South Korean Won", | |
"currency": "KRW" | |
}, | |
{ | |
"country": "LT", | |
"name": "Lithuanian Litas", | |
"currency": "LTL" | |
}, | |
{ | |
"country": "LU", | |
"name": "Luxembourg (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "LI", | |
"name": "Liechtenstein (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "LV", | |
"name": "Latvian Lats", | |
"currency": "LVL" | |
}, | |
{ | |
"country": "NL", | |
"name": "Netherlands (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "NO", | |
"name": "Norwegian Krone", | |
"currency": "NOK" | |
}, | |
{ | |
"country": "NZ", | |
"name": "New Zealand Dollar", | |
"currency": "NZD" | |
}, | |
{ | |
"country": "PL", | |
"name": "Polish Zloty", | |
"currency": "PLN" | |
}, | |
{ | |
"country": "PT", | |
"name": "Portugal (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "RU", | |
"name": "Russian Ruble", | |
"currency": "RUB" | |
}, | |
{ | |
"country": "SE", | |
"name": "Swedish Krona", | |
"currency": "SEK" | |
}, | |
{ | |
"country": "SL", | |
"name": "Slovenia (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "SK", | |
"name": "Slovakia (Euro)", | |
"currency": "EUR" | |
}, | |
{ | |
"country": "SG", | |
"name": "Singapore Dollar", | |
"currency": "SGD" | |
}, | |
{ | |
"country": "TW", | |
"name": "New Taiwan Dollar", | |
"currency": "TWD" | |
}, | |
{ | |
"country": "UA", | |
"name": "Ukrainian Hryvnia", | |
"currency": "UAH" | |
}, | |
{ | |
"country": "ZA", | |
"name": "South African Rand", | |
"currency": "ZAR" | |
} | |
] | |
}; |
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
/** | |
* Query JSON object | |
* Add this to Ajax responses or wherever you like. | |
* | |
*/ | |
// Your Country code: | |
var code = geoip.country.iso_code; | |
for (var i = 0; i < geo.locals.length; i++) { | |
var obj = geo.locals[i]; | |
if (obj.country == code) { | |
return console.log(obj.currency); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment