Format currencies using different locales and symbols
mainBy default, currency.js uses a US locale. Because currency instances are immutable, you can create specialized factory functions to handle different international formats by passing an options object to the currency() constructor.
Common options for formatting include:
precision: Number of decimal places.symbol: The currency symbol to display.decimal: The decimal separator.separator: The thousands separator.
const USD = value => currency(value);
const JPY = value => currency(value, { precision: 0, symbol: '¥' });
const EURO = value => currency(value, { symbol: '€', decimal: ',', separator: '.' });
USD(1234.567).format(); // => "$1,234.57"
JPY(1234.567).format(); // => "¥1,235"
EURO(1234.567).format(); // => "€1.234,57"