intl-currency

1.3.0 • Public • Published

intl-currency Build Status

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

Package Sidebar

Install

npm i intl-currency

Weekly Downloads

19

Version

1.3.0

License

MIT

Last publish

Collaborators

  • kevva