Plugins - numbersToWords

StarAdd to favorites
  • 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_japanese == 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

Thank You Ruby Quiz and Matthew D Moss

Charlie Bowman

http://svn.recentrambles.com/plugins/numbersToWords

Rails' (MIT)

  • Currently 4.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
Stephan 23 May 2008

the link to this plugin is broken :-(

can somebody tell me another place where I can get this plugin?

Peter 18 Apr 2007

Does this work with Rails 1.2+?

Charlie bowman 12 May 2006

This has been fixed.

Mohammad 10 May 2006

money = 123.23 money.to_dollars == one hundred and twenty-three dollars and twenty-three cents

This does not work because grammerly it should be one hundred, twenty-three dollars and twenty-three cents. The way you out put it if I convert it to numbers it would be 100.023.23 so theres an error but, besides that good work :)

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?