1.21.0 • Published 12 months ago

n2words v1.21.0

Weekly downloads
655
License
MIT
Repository
github
Last release
12 months ago

n2words

Test Coverage Status npm npm jsDelivr

n2words converts numerical numbers into written ones, supports 27 languages, and has zero dependencies.

Example

n2words(123)   // 'one hundred and twenty-three'
n2words(-1.5)  // 'minus one point five'

n2words(123, {lang: 'fr'})  // 'cent vingt-trois'
n2words(123, {lang: 'es'})  // 'ciento veintitrés'
n2words(123, {lang: 'ar'})  // 'مائة و ثلاثة و عشرون'

See the Wiki for examples and advanced usage like importing only specific languages.

Install

npm install n2words

Usage

ESM

import n2words from 'n2words'

CommonJS (dynamic import)

import('n2words').then(({default: n2words}) => {
    n2words(100)
})

Browser

<script src="./n2words.js"></script>
<script>
    n2words(100)
</script>

n2words is also available on jsDelivr.

Supported Languages

  • en (English, default)
  • ar (Arabic)
  • az (Azerbaijani)
  • cz (Czech)
  • dk (Danish)
  • de (German)
  • es (Spanish)
  • fr (French)
  • fr-BE (French (Belgium))
  • fa (Farsi)
  • he (Hebrew)
  • hr (Croatian)
  • hu (Hungarian)
  • id (Indonesian)
  • it (Italian)
  • ko (Korean)
  • lt (Lithuanian)
  • lv (Latvian)
  • nl (Dutch)
  • no (Norwegian)
  • pl (Polish)
  • pt (Portuguese)
  • ru (Russian)
  • sr (Serbian)
  • tr (Turkish)
  • uk (Ukrainian)
  • vi (Vietnamese)
  • zh (Chinese)

Contributing

This library is in active development. We want to improve the design and process for language contributors and add more languages. Bug reports and feature requests are also beneficial!

License

MIT

1.21.0

12 months ago

1.20.0

1 year ago

1.19.1

1 year ago

1.19.0

1 year ago

1.18.0

2 years ago

1.15.0

2 years ago

1.14.0

2 years ago

1.16.3

2 years ago

1.16.2

2 years ago

1.17.0

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.16.4

2 years ago

1.12.2

2 years ago

1.13.0

2 years ago

1.12.1

3 years ago

1.12.0

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago