All Projects → kevva → intl-currency

kevva / intl-currency

Licence: MIT License
Convert numbers to currencies

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].