README
Argon Formatter
Argon Formatter is universal currency formatter. This is a fork of Smirzaei's currency-formatter except that it provides UMD and ESM builds.
Install
npm install argon-formatter --save
Basic Usage
Using currency code
import * as argonFormatter from 'argon-formatter';
argonFormatter.format(1000000, { code: 'USD' });
// => '$1,000,000.00'
argonFormatter.format(1000000, { code: 'GBP' });
// => '£1,000,000.00'
argonFormatter.format(1000000, { code: 'EUR' });
// => '1 000 000,00 €'
Using locale
import * as argonFormatter from 'argon-formatter';
argonFormatter.format(1000000, { locale: 'en-US' });
// => '$1,000,000.00'
argonFormatter.format(1000000, { locale: 'en-GB' });
// => '£1,000,000.00'
argonFormatter.format(1000000, { locale: 'GB' });
// => '£1,000,000.00'
argonFormatter.format(1000000, { locale: 'de-DE' });
// => '1.000.000,00 €'
argonFormatter.format(1000000, { locale: 'nl-NL' });
// => '€1.000.000,00'
Get currency information
import * as argonFormatter from 'argon-formatter';
argonFormatter.findCurrency('USD');
// returns:
// {
// code: 'USD',
// symbol: '