Socket
Socket
Sign inDemoInstall

currency-list

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-list

Localized currency list


Version published
Weekly downloads
5.8K
increased by0.66%
Maintainers
1
Weekly downloads
 
Created
Source

Currency-list

Utility package for localized currency list

Installation

Package available via:

  • NPM npm install currency-list

Usage

Module exports CurrencyList and functions get(currency_code, locale = 'en_us') and getAll(locale?) where currency_code is ISO 4217 currency code and locale is ISO 3166‑1

Example

import CurrencyList from 'currency-list'

console.log(CurrencyList.getAll()) // Prints all currency lists for all locales
console.log(CurrencyList.getAll('en_US')) // Prints all currency lists for en_US locale
console.log(CurrencyList.get("EUR"))
/* Prints  {
    name: 'Euro',
    symbol_native: '€',
    symbol: '€',
    code: 'EUR',
    name_plural: 'euros',
    rounding: 0,
    decimal_digits: 2
  } as in default locale 'en_US'
  */
console.log(CurrencyList.get("UAH", 'zh'))
/* Prints {
    name: '乌克兰格里夫纳',
    symbol_native: '₴',
    symbol: '₴',
    code: 'UAH',
    name_plural: 'Ukrainian hryvnias',
    rounding: 0,
    decimal_digits: 2
  } as in 'zh' locale */

Contributing

All contributions are welcome as pull request or issues in github repository. Most contributions appreciated for name_plura attribute for each locale as it requires knowladge of the language.

Credits

Prepared by Webplan.pro from different public sources. Feel free to use it as you need in your apps or send updates into this public repository. It's under MIT license.

Keywords

FAQs

Package last updated on 30 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc