coinify

Get currency information and symbol from ISO code

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
coinify
1922.0.25 years ago5 years agoMinified + gzip package size for coinify in KB

Readme

Install ```.batch npm i coinify -s ``` Usage ```.js import coinify from 'coinify' console.log(coinify.symbol('USD')) // Prints '$' ``` Functions coinify.get(code) Example ```.js coinify.get('USD') ``` returns ```.js { 'symbol': '$', 'name': 'US Dollar', 'symbolnative': '$', 'decimaldigits': 2, 'rounding': 0, 'code': 'USD', 'nameplural': 'US dollars' } ``` coinify.symbol(code, native = true) Example ```.js coinify.symbol('NOK') ``` returns ```.js 'kr' ``` & ```.js coinify.symbol('NOK', false) ``` returns ```.js 'Nkr' ``` coinify.decimals(code) Example ```.js coinify.decimals('USD') ``` returns ```.js 2 ``` coinify.rounding(code) Example ```.js coinify.rounding('USD') ``` returns ```.js 0 ``` coinify.name(code, plural = false) Example ```.js coinify.name('USD') ``` returns ```.js 'US Dollar' ``` & ```.js coinify.name('USD', true) ``` returns ```.js 'US dollars' ``` References: https://en.wikipedia.org/wiki/ISO4217 http://www.iotafinance.com/en/ISO-4217-Currency-Codes.html http://www.xe.com/symbols.php https://gist.github.com/Fluidbyte/2973986