Forum: Ruby on Rails [ANN] numeric_spell plugin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Benjamin S. (Guest)
on 2005-12-31 23:45
(Received via mailing list)
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 O. for inspiring me to get off my ass and release
this.)

-Ben
Kevin O. (Guest)
on 2005-12-31 23:48
Benjamin S. 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 O. for inspiring me to get off my ass and release
> this.)
>
> -Ben

Take a look at this to avoid the <1,000 limitation.

http://www.bigbold.com/snippets/posts/show/704
Benjamin S. (Guest)
on 2005-12-31 23:54
(Received via mailing list)
> Take a look at this to avoid the <1,000 limitation.
>
> http://www.bigbold.com/snippets/posts/show/704

Nice. 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
This topic is locked and can not be replied to.