On Tue, Dec 25, 2012 at 4:41 AM, Marc H. [email protected]
Anyone knows if standard ruby has this available?
5.en.numwords # => “five”
1.en.numwords # => “one”
This is part of the Linguistics gem, but I wonder why
standard Ruby does not have this available?
I am guessing that translation and natural language handling are not
considered basic i18n functionality. That makes a whole lot of sense
if you consider that it is complicated and there are usually a lot
different possible approaches. Whichever you put into the core or
standard library you will only help part of the Ruby population.
Using a gem for this does not seem to be such a bad alternative.
To be able to convert “5” to “five” seems useful
everytime I want to output something to the user.
Well, you could create a poor man’s version if you feel the gem is too
NUMBERS =%w[zero one two three four five six seven eight nine]