1.0.6 • Published 6 years ago

amount v1.0.6

Weekly downloads
388
License
MIT
Repository
github
Last release
6 years ago

amount

Amount and currency formatter

npm Build Status GitHub license

node

npm i amount --save

yarn

yarn add amount

Usage

// amount(amount, decimals_separator, thousands_separator, decimal_digits)

amount(87686.987);
// '87686.987'

// setting decimals separator

amount(87686.987, ',');
// '87686,987'

// setting thousands separator

amount(87686.987, ',', '.');
// '87.686,987'

// setting number of decimals

amount(87686.987, ',', '.', 2);
// '87.686,98'

amount(87686.987, ',', '.', 1);
// '87.686,9'

amount(87686, ',', '.', 2);
// '87.686,00'

currency

amount.currency(87686.987, 'EUR');
// '87 686,98 €'

amount.currency(87686.987, 'USD');
// '$87,686.98'

amount.currency(87686.987, {
  thousands_separator: ',',
  decimals_separator: '.',
  decimal_digits: 2,
  symbol: '€',
  symbol_on_left: false,
  symbol_space: ' ',
});
// '87.686,98 €'
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago