humanize-bytes-india
v1.0.1
Published
Convert bytes into human-readable format with Indian unit support
Maintainers
Readme
📦 humanize-bytes-india
Convert byte values into human-readable strings (KB, MB, GB) — with support for Indian units like Lakh and Crore.
📥 Installation
npm install humanize-bytes-india🚀 Usage
const humanizeBytes = require('humanize-bytes-india');
console.log(humanizeBytes(1048576));
// Output: "1.00 MB" (Default SI system)
console.log(humanizeBytes(1048576, { system: "Indian" }));
// Output: "1.00 MB"
console.log(humanizeBytes(100000000, { system: "Indian", decimals: 1 }));
// Output: "95.4 Lakh"⚙️ Options
| Option | Type | Default | Description |
|------------|---------|---------|------------------------------------|
| system | string | "SI" | "SI" or "Indian" units |
| decimals | number | 2 | Number of decimal places |
| suffix | boolean | true | Add unit suffix (e.g., "MB", "GB") |
✅ Use Cases
- Display file sizes in dashboards and UI
- Show readable byte values in logs and analytics
- Tailor output for Indian audiences (Lakh, Crore)
🛠 Example
humanizeBytes(5000000000);
// Output: "4.66 GB"
humanizeBytes(95000000, { system: "Indian", suffix: true });
// Output: "90.48 Lakh"📄 License
MIT © 2025 Sathish Kumar K
