Number formatter for components that converts large numbers into human-readable letter format (k, M, G, T). Current stable version: 0.0.7 (latest). No release cadence documented. Simple, lightweight, with no dependencies. Provides a single function `getNumberThousands` to format numbers with configurable decimals and decimal separator. Limited to European-style decimal commas and thousands separators. Not suitable for locale-aware formatting or scientific notation. Minimalism differentiates it from full-featured libraries like numeral.js or Intl.NumberFormat.
npm install ik-number-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using getNumberThousands with various formatting options.
Always pass a value for decimalSeparator, e.g., ',' or '.'.
Always use dot as decimal separator in JavaScript numbers. The library's output uses the provided decimalSeparator.
Use require() or ensure bundler handles CommonJS interop.
Test with your expected range; may not handle edge cases.
Use: const ikNumberFormatter = require('ik-number-formatter');Run: npm install ik-number-formatter
Pass decimals as second argument: getNumberThousands(5000, 2, ',') returns '5,00K'
No dependency data recorded yet.