Skip to content

Instantly share code, notes, and snippets.

@Nomon
Created June 21, 2011 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nomon/1037767 to your computer and use it in GitHub Desktop.
Save Nomon/1037767 to your computer and use it in GitHub Desktop.
var getCurrencyByGeoCode = function(country) {
if(country == "US") {
return "USD";
} else if(country == "GB") {
return "GBP";
} else if(country == "JP") {
return "JPY";
} else if(country == "CA") {
return "CAD";
} else if(country == "AU" || country == "NZ") {
return "AUD";
// Euro countries as of 21.6.2011
} else if( utils.inArray(country,["AT","BE","CY","EE","FI","FR","DE","GR","IE","IT","LU","MT","NL","PT","SK","SI","ES"]) ) {
return "EUR";
} else {
return "USD";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment