Plugin: NumbersToWords
June 16, 2006
In my RAILS application I need to convert numbers to words. I started writing own function but before I finish that I got an amazing Plugin.
This Plugin is capable to convert number to words.
Following are some examples
>> 5.to_english
=> “five”
>> 123456.to_english
=> “one hundred twenty-three thousand four hundred and fifty-six”
>> 2.5.to_english
=> “two”
>> (2.5).to_english
=> “two”
>> (2.5).to_dollars
=> “two dollars and fifty cents”
>> 5.to_japanese
=> “go”
>> (2.5).to_japanese
=> “ni”
install this plugin by :
script/plugin install http://svn.recentrambles.com/plugins/numbersToWords
Entry Filed under: Ruby, RubyonRails, rails, rails plugins. .
2 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed







1.
Tomasz mazur | August 10, 2008 at 11:22 am
I wrote my won plugin for this:
http://agilewebdevelopment.com/plugins/verbal
2.
Peter | July 21, 2009 at 1:18 pm
This plugin is no longer at the svn address above. I’ve put it on github. You can get it here: http://github.com/accidental/numbersToWords