DEV Community

Muhammad Syarwani
Muhammad Syarwani

Posted on

๐Ÿงฎ Introducing number-to-words-id โ€” Convert Numbers to Words in 3 Languages

๐Ÿงฎ 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"
Enter fullscreen mode Exit fullscreen mode

โš™๏ธ 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


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)