intl-currency
v1.3.0
Published
Convert numbers to currencies
Downloads
36
Readme
intl-currency
Convert numbers to currencies
Install
$ npm install --save intl-currency
Usage
var intlCurrency = require('intl-currency');
intlCurrency(129, {
currency: 'USD',
locales: 'en-US'
});
//=> $129.00
intlCurrency(129, {
currency: 'SEK',
locales: 'sv-SE',
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
//=> 129 kr
API
intlCurrency(value, options)
value
Type: number
, string
The value to convert.
options
See this link for all possible options.
currency
Required
Type: string
The currency to use in formatting. Possible values are the ISO 4217 currency codes, such as USD
for the US dollar or EUR
for the euro. See the currency code list for all possible values.
locales
Required
Type: array
, string
A string with a BCP 47 language tag, or an array of such strings.
License
MIT © Kevin Mårtensson