๐งฎ I Built a Library to Convert Numbers into Words in 3 Languages
Have you ever needed a โterbilangโ function in your project?
When I worked on billing and invoice systems, I realized that most libraries only support English โ none for Indonesian or Malay.
So I decided to create number-to-words-id
.
Itโs a lightweight Node.js library that converts numbers into words in Indonesian, Malay, and English โ all offline, no dependencies.
๐ Quick Example
import { toWords } from "number-to-words-id";
console.log(toWords(75000));
// "tujuh puluh lima ribu"
console.log(toWords(75000, { lang: "en" }));
// "seventy-five thousand"
console.log(toWords(75000, { lang: "ms" }));
// "tujuh puluh lima ribu"
โ๏ธ Features
- ๐ฎ๐ฉ Indonesian, ๐ฒ๐พ Malay, ๐ฌ๐ง English
- Currency and ordinal support
- Clean, dependency-free JavaScript
- Tiny size and fast performance
๐ก Why I Built It
Because every time I saw terbilang(12345)
in projects, it was always a custom function someone copied from StackOverflow ๐
Now, we have a proper open-source version โ tested, maintained, and versioned on npm.
๐ Links
- ๐ฆ npm: number-to-words-id
- ๐ป GitHub: github.com/ibnushahraa/number-to-words-id
If you find it useful, please give it a โญ on GitHub โ itโll help more developers discover it!
Iโd also love to hear feedback or feature ideas.
Tags: #nodejs #javascript #npm #opensource #indonesia
Top comments (0)