terbilang-id
v1.0.0
Published
Convert numbers into Indonesian words
Maintainers
Readme
terbilang-id
Convert numbers into Indonesian words effortlessly 🇮🇩
Simple, lightweight, and fully typed utility to convert numbers into Indonesian text.
✨ Features
- 🇮🇩 Indonesian number spelling
- 🔢 Decimal support
- ➖ Negative number support
- 🔠 Multiple casing options
- ⚡ Zero dependency
- 📦 TypeScript support
- 🧪 Fully tested with Vitest
📦 Installation
npm install terbilang-idyarn add terbilang-idpnpm add terbilang-id🚀 Usage
Basic
import { terbilang } from 'terbilang-id';
terbilang(12);Output:
dua belasThousands
terbilang(12500);Output:
dua belas ribu lima ratusMillions
terbilang(1500000);Output:
satu juta lima ratus ribuBillions
terbilang(1500000000);Output:
satu miliar lima ratus jutaTrillions
terbilang(1000000000000);Output:
satu triliunDecimal Support
terbilang(12.5);Output:
dua belas koma limaNegative Number
terbilang(-99);Output:
minus sembilan puluh sembilan🔠 Casing Options
Uppercase
terbilang(1000, {
casing: 'upper',
});Output:
SERIBUCapitalize
terbilang(1000, {
casing: 'capitalize',
});Output:
Seribu⚙️ API
terbilang(value, options?)
| Parameter | Type | Description |
|---|---|---|
| value | number | Number to convert |
| options | TerbilangOptions | Optional configuration |
TerbilangOptions
| Option | Type | Default |
|---|---|---|
| casing | 'lower' \| 'upper' \| 'capitalize' | 'lower' |
🧪 Running Tests
npm run test🛠 Development
npm run buildnpm run dev📂 Project Structure
src/
├── converter.ts
├── index.ts
└── types.ts🔥 Future Plans
- Multi-language support
- Currency extension package
- Reverse parser (
fromTerbilang) - Browser playground
- Roman numeral utilities
🤝 Contributing
Contributions are welcome!
Feel free to open issues or submit pull requests.
📄 License
MIT License © 2026 Egho Pratama
