awesome-javascript
awesome-javascript copied to clipboard
Add n2words
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'}) // 'مائة و ثلاثة و عشرون'