4.0.5 • Published 6 years ago

currency-map-symbol v4.0.5

Weekly downloads
902
License
MIT
Repository
github
Last release
6 years ago

A function to lookup the currency symbol for a given currency code.

Installation

npm install currency-map-symbol

Test

Simple test

npm run test

Test with watch

npm run test:watch 

Test coverage

npm run test:coverage  
     

Usage

Get symbol from currency code

// ES5
const getSymbolFromCurrency = require('currency-map-symbol')

// ES6
import getSymbolFromCurrency from 'currency-map-symbol'

getSymbolFromCurrency('GBP') //=> '£'
getSymbolFromCurrency('EUR') //=> '€'
getSymbolFromCurrency('USD') //=> '$'
getSymbolFromCurrency('NOT A VALID CODE') //=> undefined

Exposed map for other processing

// ES5
const getSymbolFromCurrency = require('currency-map-symbol')

// ES6
import getSymbolFromCurrency from 'currency-map-symbol'

/* =>
{
 "USD" : "$",
 "GBP" : "£",
 …
}
*/

Credits

Currency symbols originally sourced from xe

4.0.5

6 years ago

4.0.4

6 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.6

7 years ago

3.1.5

7 years ago

3.1.4

7 years ago

3.1.3

7 years ago

3.1.2

7 years ago