currency-reference
v1.0.0
Published
Currency reference (ISO 4217)
Downloads
4
Maintainers
Readme
Currency reference (ISO 4217)
Installation
yarn add currency-reference
Usage
Import
import { currencies } from "currency-reference/dist/currencies";
Get currency by currency code
const currency = currencies.get('USD');
Get currency by currency number
const currency = currencies.getByNumber(840);
Set the default language ('en' or 'ru'). 'en' - default
currencies.setLanguage('ru');
Examples
currency.getName(); // 'US Dollar'
currency.getName('ru'); // 'Доллар США'
currency.getCode(); // 'USD'
currency.getNumber(); // 840
currency.getDefaultSymbol(); // '$'
currency.getMinorUnits(); // 2
currency.getDividedInto(); // 100
Get all currencies
currencies.getAll(); // {AED: Currency, AFN: Currency, ALL: Currency, AMD: Currency, ANG: Currency, …}