Miss any of our Open RFC calls?Watch the recordings here! »

coinify

2.0.2 • Public • Published

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

Install

npm i coinify

DownloadsWeekly Downloads

446

Version

2.0.2

License

MIT

Last publish

Collaborators

  • avatar