1.3.0 • Published 8 years ago

intl-currency v1.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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