A standalone JavaScript library for formatting numbers with customizable patterns, currency symbols, separators, and signs. Version 1.1.0 is the current stable release, available via npm and yarn. It provides two main formatting functions (formatFromPattern and formatFromConfig) and a pattern parser. Key differentiator: pattern-based formatting similar to Java's DecimalFormat, with no external dependencies, ESM and CJS support.
npm install number-formatter-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: formatting with pattern, signing, config reuse, and custom separator.
Use '+0,000.00' not '+ 0,000.00'.
Use options.separator for thousands separator; decimal point always '.'.
To include zeros in prefix, modify config.prefix after parsePattern.
Use: import { formatFromPattern } from 'number-formatter-js' or const { formatFromPattern } = require('number-formatter-js')Ensure pattern follows guidelines: signs directly before mask, only 0, ,, ., +, - allowed in mask.
No dependency data recorded yet.