JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 405
  • Score
    100M100P100Q92002F
  • License MIT

Get currency information and symbol from ISO code

Package Exports

  • coinify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coinify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Install

npm i coinify -s

Usage

import coinify from 'coinify'

console.log(coinify.symbol('USD')) // Prints '$'

Functions


coinify.get(code)

Example

coinify.get('USD')

returns

{
  'symbol': '$',
  'name': 'US Dollar',
  'symbol_native': '$',
  'decimal_digits': 2,
  'rounding': 0,
  'code': 'USD',
  'name_plural': 'US dollars'
}

coinify.symbol(code, native = true)

Example

coinify.symbol('NOK')

returns

'kr'

&

coinify.symbol('NOK', false)

returns

'Nkr'

coinify.decimals(code)

Example

coinify.decimals('USD')

returns

2

coinify.rounding(code)

Example

coinify.rounding('USD')

returns

0

coinify.name(code, plural = false)

Example

coinify.name('USD')

returns

'US Dollar'

&

coinify.name('USD', true)

returns

'US dollars'

References:

https://en.wikipedia.org/wiki/ISO_4217 http://www.iotafinance.com/en/ISO-4217-Currency-Codes.html http://www.xe.com/symbols.php https://gist.github.com/Fluidbyte/2973986