sindresorhus / awesome-nodejs

:zap: Delightful Node.js packages and resources
https://node.cool
Creative Commons Zero v1.0 Universal
57.56k stars 5.81k forks source link

Add n2words #1206

Closed forzagreen closed 1 year ago

forzagreen commented 1 year ago

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

I put it under the Humanize section. I could also go under Natural language processing.

romankurnovskii commented 1 year ago

What is the advantage over https://www.npmjs.com/package/to-words ?

forzagreen commented 1 year ago

@romankurnovskii n2words supports much more languages: 27 vs 9.

romankurnovskii commented 1 year ago

I see 18, so this is a question, if the issue is only in amount of languages why not to add translation or there are some more features? I use this maintained package, just want to know if there is a good reason to look at something new

forzagreen commented 1 year ago

@romankurnovskii

romankurnovskii commented 1 year ago

forzagreen

thank you @forzagreen for explanation

sindresorhus commented 1 year ago

The package looks fine, but I don't think it's a common need. I try to curate the most common things users will need here. For this package, the user can easily search for it if they need it.