David Alan Black <dblack / candle.superlink.net> writes:

>Input:   123456
>Output:  "one-hundred twenty-three thousand four-hundred fifty-six"
>Solutions in other languages welcome too.

Common Lisp's 'format' routine offers this as a built-in facility with the
~r directive:

* (format t "~r" 12345678901234567890)

twelve quintillion three hundred forty-five quadrillion six hundred
seventy-eight trillion nine hundred one billion two hundred thirty-four
million five hundred sixty-seven thousand eight hundred ninety

I had a need for something similar (though upto a million would have
sufficed) a short while ago and wrote an equivalent in Python.  A mechanical
transilteration to Ruby is also available:

http://www.cs.indiana.edu/~raja/code/Cardinal.py
http://www.cs.indiana.edu/~raja/code/Cardinal.rb

Raja