awesome-javascript icon indicating copy to clipboard operation
awesome-javascript copied to clipboard

Add n2words

Open forzagreen opened this issue 3 years ago • 0 comments

Checklist:

  • [x] I've read and understood Contributing Guidelines.
  • [x] I've added the new resource at the end of its section.
  • [x] This resource is out there for a while, and actively maintained.
  • [ ] This resource is popular enough and has at least a few hundred stars on GitHub.

n2words converts numbers to a human readable string. As of today, it supports 26 languages.

Examples:

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'})  // 'مائة و ثلاثة و عشرون'

forzagreen avatar Jan 11 '23 11:01 forzagreen