Lightweight library for formatting amounts and currencies in JavaScript. Version 1.0.6 provides two main functions: `amount()` for number formatting with customizable decimal and thousands separators, and `amount.currency()` for locale-based or fully custom currency formatting. It supports all major currencies (EUR, USD, etc.) with automatic symbol placement and spacing. The package is dependency-free, uses CJS (CommonJS) modules, and is available via npm. Updated infrequently; last release in 2022.
npm install amountNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic number formatting and currency formatting with both automatic and custom options.
No, it does not mutate. But note that decimal_digits parameter truncates (not rounds).
Ensure arguments are in correct order: amount(value, decimals_separator, thousands_separator, decimal_digits).
Use Intl.NumberFormat for full locale support.
Use require('amount') instead of import.Ensure you call require('amount') and use amount.currency(). Avoid tree-shaking by using require().Call amount.currency(...) instead.
No dependency data recorded yet.