Forum: Ruby on Rails [ANN] NumbersToWords

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Charlie B. (Guest)
on 2006-05-10 15:45
(Received via mailing list)
= numbersToWords - convert your integers and floats to english or
japaneese words,or translate it into american currency

- This plugin was created from a solution to the ruby quiz (english
numbers) by Matthew D Moss.  I modified the code to work as a rails
plugin and added the to_dollars method.
- the to_dollars method will work with integers and floats
- the to_english and to_japaneese methods will only work with integers.
If you have call these methods on a float, it will be converted to an
integer before translating.

= Examples
 123.to_english == one hundred and twenty-three
 123.to_japaneese == hyaku niju san
 123.to_dollars == one hundred and twenty-three dollars
 money = 123.23
 money.to_dollars == one hundred and twenty-three dollars and
twenty-three cents
 money = 1.01
 money.to_dollars == one dollar and one cent

= Install script/plugin install

= License
 Ruby's - Do whatever you want whenever you want, with any part or all
of this code.

= Contributions
 you can send patches, questions, or feature requests to

= Thank You Ruby Q. and Matthew D Moss

Charlie B.
Benjamin C. (Guest)
on 2006-05-10 18:09
(Received via mailing list)
Posted at :)
Benjamin C. -- Collaborative test case management -- Resources for the Rails community
Mohammad (Guest)
on 2006-05-10 20:12
The .to_dollars does not work "and" means decimal so,
" money = 123.23
 money.to_dollars == one hundred and twenty-three dollars and
twenty-three cents"
now if I were to put that back into numbers this is how it grammerly
should come out: 100.23.23
thats one error, but, besides that great work :)
Charlie B. (Guest)
on 2006-05-10 21:40
(Received via mailing list)
Thanks, someone pointed that out to me earlier.  It's been fixed.  a
fresh install of the plugin should fix your problem.

Charlie B.
This topic is locked and can not be replied to.