From Numbers to Words [40B]
From and Idea from James Kanze
Write a program that will convert a number into its spoken form. For example, given '12' as input the output should be 'twelve'. Given '1041' the output should be 'a thousand and fourteen'. The program should cope with floating point values as well.
Variants
- Repeat the program but for some other language such as French (and be careful because not all French speaking countries use the same names for all numbers).
- Write a program that converts numbers written in words to numerical values. Note that you will need to parse the input and discard connecting words such as uses of 'and'.