i18n-num-in-words
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

i18n-num-in-words

Convert Numbers to Words in Multiple Languages

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:

GitHub stars

Features

  • 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.

Installation

To start, choose the package manager you are most comfortable with:

npm

npm install i18n-num-in-words

yarn

yarn add i18n-num-in-words

pnpm

pnpm add i18n-num-in-words

bun

bun add i18n-num-in-words

Usage Example

To convert numbers to words, first import the relevant function from the package.

Indonesian

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'

English

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'

Arabic

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.5
14latest
1.0.6-canary.1717747290
1canary

Version History

VersionDownloads (Last 7 Days)Published
1.0.6-canary.1717747290
1
1.0.5
14
1.0.5-canary.1708397183
1
1.0.5-canary.1707797575
1
1.0.5-canary.1706769408
1
1.0.5-canary.1705034029
1
1.0.5-canary.1705034008
1
1.0.5-canary.1705033844
1
1.0.5-canary.1705033586
1
1.0.4-canary.1704970797
1
1.0.3-canary.1704970537
1
1.0.3-canary.1704970421
1
1.0.4
1
1.0.3-canary.1702559554
2
1.0.3-canary.1702559379
1
1.0.3-canary.1702559214
1
1.0.2-canary.17025563771
1.0.31
1.0.2-canary.17025560981
1.0.1-canary.17025553461
1.0.1-canary.17025530781
1.0.1-canary.17025528131
1.0.1-canary.16995183611
1.0.21
1.0.1-canary.16995011211
1.0.11
1.0.1-canary.16995009011
1.0.1-canary.16994999511
1.0.1-canary.16994994141
1.0.1-canary.16994992992
1.0.1-canary.16994989151
1.0.1-canary.16994988251
1.0.01

Package Sidebar

Install

npm i i18n-num-in-words

Weekly Downloads

48

Version

1.0.5

License

MIT

Unpacked Size

32.4 kB

Total Files

6

Last publish

Collaborators

  • imbios