Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

currency-format

xsolla11.2kMIT1.0.13

JSON with information about currencies: codes (ISO 4217), the names, grapheme (symbols) and formatting.

currency, grapheme, symbols, iso 4217, format, json

readme

Currency Format JSON

npm version bower version

JSON with information about currencies: codes (ISO 4217), the names, grapheme (symbols), fraction and formatting.

Installation

Copy the JSON file into your project or use npm/bower package manager:

  • Execute the following command: npm install currency-format or bower install currency-format

Usage

The structure of the JSON file:

{
  'AMD': {                          // ISO 4217 currency code.
     'name': 'Armenian Dram',       // Currency name.
     'fractionSize': 2,             // Fraction size, a number of decimal places.
     'symbol': {                    // Currency symbol information.
         'grapheme': 'դր.',         // Currency symbol.
         'template': '1 $',         // Template showing where the currency symbol should be located
                                    // (before or after amount).
         'rtl': false               // Writing direction.
     },
     'uniqSymbol': {                // Alternative currency symbol. We recommend to use it when you want
                                    // to exclude a repetition of symbols in different currencies.
         'grapheme': 'դր.',         // Alternative currency symbol.
         'template': '1 $',         // Template showing where the alternative currency symbol should be
                                    // located (before or after amount).
         'rtl': false               // Writing direction.
     }
  },
  ...
}

symbol/uniqSymbol field is null, when the currency has no symbol/alternative symbol.

Currency reference

The list of currency codes was taken from https://en.wikipedia.org/wiki/ISO_4217.

License

The MIT License.

See LICENSE

changelog

Changelog

1.0.13 - 2020-01-29

  • [fix] Updated grapheme for USD

1.0.12 - 2019-11-27

  • [feature] Add Symbols for 53 currencies.

1.0.11 - 2018-09-04

  • [feature] Updated ISO for Bolivar.
  • [fix] MGA fraction size and name.
  • [fix] XOF and XAF info.

1.0.10 - 2018-04-25

  • [fix] Updated fraction size for IRR.

1.0.9 - 2018-03-20

  • [fix] Updated grapheme for IRR.

  • [fix] Updated fraction size and name of MGA.

  • [fix] Updated the CFA francs (XAF/XOF).

1.0.8 - 2017-12-15

  • [feature] Add cryptocurrencies ETH, BTC, LTC

1.0.7 - 2017-01-26

  • [fix] Fixed fraction size for IDR.

  • [fix] Updated grapheme for PEN.

  • [fix] Removed grapheme for CHF.

  • [fix] Fixed fraction size for BYN.

1.0.6 - 2016-06-30

  • [feature] Add uniqSymbol for BYR and BYN.

1.0.5 - 2016-06-29

  • [feature] Add symbol template for new Belarussian Ruble (BYN). Remove (set null) uniqSymbol for Belarussian Ruble (BYR).

1.0.4 - 2016-06-16

  • [feature] Register in Bower.

  • [feature] Added 'main' field to package.json to make package requirable.

  • [fix] Fixed some names of currencies.

1.0.3 - 2016-05-19

  • [fix] Fix symbol template for Yuan Renminbi (CNY).

1.0.1 - 2016-02-12

  • [feature] Added Turkish Lira grapheme.