RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Convert numbers to English words

I’ve created rails plugin that converts numbers (integers) to its textual presentation in English or Polish. You can find it here: http://github.com/tomaszmazur/verbal/tree/master

Examples of usage:

NOTE: It’s American English numbering system http://www.mazes.com/AmericanNumberingSystem.html

Verbal::English::Numbers.to_words(123_456_789) => “one hundred twenty-three million four hundred fifty-six thousand seven hundred and eighty-nine”

Verbal::Polish::Numbers.to_words(123_456_789) => “sto dwadzieścia trzy miliony czterysta pięćdziesiąt sześć tysiecy siedemset osiemdziesiąt dziewięć”

P.S. I am looking for collaborators. I want add support for more languages. Feedback also appreciated (bugs, ideas, etc…)

Comments

Maybe call it acts_as_419scam?

mtkd: do you insinuate something?

there is no such library in Ruby like: http://pear.php.net/package/Numbers_Words in PHP.

Currently I work on financial app (conversion of currencies to text representation is a must), so tell me ‘mtkd’ what’s wrong with sharing my work with Ruby community?

@tomasmazur - Sounds like it was just a friendly joke ;)

That’s really cool, I will contribute maybe with a german variant, if my time allows it.

trísécheithreochttrínaoiamháinnáidseachtséamháinamháincheithredhádhá

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in