tkrotoff / locale-currency

A map of i18n country codes to ISO 4217 currency codes.

Home Page:https://www.npmjs.com/package/locale-currency

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

locale-currency

A map of i18n country codes to ISO 4217 currency codes.

Examples

var LocaleCurrency = require('locale-currency');
var assert = require('assert');
assert(LocaleCurrency.getCurrency("us") === "USD");
assert(LocaleCurrency.getCurrency("US") === "USD");
assert(LocaleCurrency.getCurrency("Us") === "USD");
assert(LocaleCurrency.getCurrency("uS") === "USD");
assert(LocaleCurrency.getCurrency("EN_US") === "USD");
assert(LocaleCurrency.getCurrency("en_us") === "USD");
assert(LocaleCurrency.getCurrency("EN-US") === "USD");
assert(LocaleCurrency.getCurrency("en-us") === "USD");
assert(LocaleCurrency.getCurrency("GB") === "GBP");
assert(LocaleCurrency.getCurrency("ES") === "EUR");
assert(LocaleCurrency.getCurrency("GR") === "EUR");


var euroCountries = LocaleCurrency.getLocales("EUR");
assert(euroCountries.indexOf("GR") > -1); // Germany
assert(euroCountries.indexOf("FR") > -1); // France
assert(euroCountries.indexOf("ES") > -1); // Spain

About

A map of i18n country codes to ISO 4217 currency codes.

https://www.npmjs.com/package/locale-currency

License:MIT License


Languages

Language:JavaScript 89.2%Language:Java 10.8%