New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

currency-reference

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-reference

Currency reference (ISO 4217)

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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, …}

Keywords

typescript

FAQs

Package last updated on 22 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts