I''ve created a plugin that lets you spell out numbers (under one thousand, in English, for now). Examples: >> 23.spell => "twenty-three" >> 23.spell :noun => ''person'' => "twenty-three people" >> (23.14).spell_currency => "twenty-three dollars and fourteen cents" >> (23.14).spell_currency(:major => ''beer'', :minor => ''shot'') => "twenty-three beers and fourteen shots" It''s available in the regular plugin interface after a "script/plugin discover". (Thanks to Rick Olson for inspiring me to get off my ass and release this.) -Ben
Benjamin Stiglitz wrote:> I''ve created a plugin that lets you spell out numbers (under one > thousand, in English, for now). > > Examples: > > >> 23.spell > => "twenty-three" > >> 23.spell :noun => ''person'' > => "twenty-three people" > > >> (23.14).spell_currency > => "twenty-three dollars and fourteen cents" > >> (23.14).spell_currency(:major => ''beer'', :minor => ''shot'') > => "twenty-three beers and fourteen shots" > > It''s available in the regular plugin interface after a "script/plugin > discover". > > (Thanks to Rick Olson for inspiring me to get off my ass and release > this.) > > -BenTake a look at this to avoid the <1,000 limitation. http://www.bigbold.com/snippets/posts/show/704 -- Posted via http://www.ruby-forum.com/.
> Take a look at this to avoid the <1,000 limitation. > > http://www.bigbold.com/snippets/posts/show/704Nice. The rest of that code looks structurally cleaner, too; I''ll pick up the changes in the next few days, unless someone wants to write a patch. -Ben