A simple Indian currency formatter that converts numbers to Indian numbering system (lakhs, crores) with ₹ symbol, locale-aware grouping, and decimal support. Current version 1.0.5 is stable with minimal updates. Key differentiator: lightweight, zero-dependency, supports numbers and strings, handles negative values and large numbers up to billions. Suitable for Node.js and browser environments.
npm install rupee-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates formatting various Indian currency values including decimals, large numbers, negatives, and edge cases like empty string and invalid input.
Validate input before passing: if (!input) return '';
Use isNaN or typeof check to handle invalid inputs.
No fix; consider alternatives like Intl.NumberFormat for more control.
Use Intl.NumberFormat with 'en-IN' locale for modern projects.
Change import to: import rupeeFormatter from 'rupee-formatter'
Add a declaration file: declare module 'rupee-formatter'; or use @ts-ignore.
Ensure input is a valid number: parseFloat(input) or use regex.
Filter falsy inputs: if (!input && input !== 0) return '';
No dependency data recorded yet.