A small, zero-dependency JavaScript library for converting numbers to words in multiple languages. Optimized for both Node.js and browser environments. Star us on GitHub for more updates:
- Internationalized: 95% of the world speaks languages other than English. We got you covered.
- Fully type safe: Leverage TypeScript's type inference and static type safety.
- Small bundle size: Zero dependencies make
i18n-num-in-words
lightweight. - Test Coverage: Nearly 100% test coverage guarantees reliability.
- Tree-shaking: Import only the languages you use to optimize your bundle size.
To start, choose the package manager you are most comfortable with:
npm install i18n-num-in-words
yarn add i18n-num-in-words
pnpm add i18n-num-in-words
bun add i18n-num-in-words
To convert numbers to words, first import the relevant function from the package.
import { indonesianNumInWords } from 'i18n-num-in-words';
console.log(indonesianNumInWords(1234567890));
Outputs: 'satu miliar dua ratus tiga puluh empat juta lima ratus enam puluh tujuh ribu delapan ratus sembilan puluh'
import { englishNumInWords } from 'i18n-num-in-words';
console.log(englishNumInWords(1234567890));
Outputs: 'one billion two hundred thirty four million five hundred sixty seven thousand eight hundred ninety'
import { arabicNumInWords } from 'i18n-num-in-words';
console.log(arabicNumInWords(1234567890));
Outputs: 'مليار واحد ومائتان وأربعة وثلاثون مليون وخمسمائة وستة وسبعون ألف وثمانمائة وتسعون'
For details, check out our full documentation.
Feel free to star us on GitHub and contribute: i18n-num-in-words GitHub Repo