Shows you how to count in any of the following languages: Bahasa Indonesia Binary Decimal (several variants) Dutch (modern, old and banker's) English (British, North American, Ordinals) Esperanto French German Grams Hexadecimal Icelandic Italian Japanese Martian Metric Metric Prefixes (grams) Norwegian Octal Polish RAM (bytes) Roman Numerals Spanish Swedish Swiss French Tagalog Time Intervals You can enter a number and it spells it out in words: e.g. -12345 to "minus twelve thousand three hundred forty-five" The classes it uses for conversion can be easily cannibalised for your own applications, e.g. writing cheques out in words. for example: String numStr = BritishEnglish.inWords(-1234); will generate the string: "minus one thousand two hundred four" handles longs up to Long.MAX_VALUE, namely: 9,223,372,036,854,775,807 Useful to learn to count in a foreign language. The InWords package classes are also useful for cheque writing or legal documents. You can run a batch test of any language with java com.mindprod.inwords.Polish where Polish is the name of the class handling the language you want to test. You can also run it as an Applet or a standalone GUI application. To install, Extract the zip download with WinZip, available from http://www.winzip.com (or similar unzip utility) into any directory you please, often C:\ -- ticking off the "user folder names" option. To run as an application, type: java.exe -jar C:\com\mindprod\inwords\inwords.jar adjusting as necessary to account for where the jar file is. Why the number 42 as the icon? It is a reference to Douglas Adam's Hitchhiker's Guide to the Galaxy. It is the number that represents the deep inner meaning of the universe. What better number to convert into words? Why is the Code Written the Way It Is There is one class for each language. Each class implements the ToWords interface. This makes it easy to for anyone to add new languages without even recompiling the code. It works right to left so that it can avoid the CPU overhead of divisions for high order parts when there aren't any high order digits. It accentuates all asymmetry by using a common loop body for each part of the number. Part of the reason for writing these classes was to understand the structure of human language and unravelling the loops would mask those quirks, even if it made the code simpler. I am trying to demonstrate how humans don't really like simplicity, consistency or regularity. Familiarity masks the bizarre complexity of your native language. It is written hopefully so that a non-native speaker could understand the code. The use of temporary boolean variables in particular was done for clarity at the expense of program size/speed. It is table driven as much as possible so that classes for new lanuages can be written easily by taking an existing driver, changing the tables, then tweaking just a little logic, perhaps cobbling together bits of logic from other language classes, that all work with the same table-driven pattern. A novice programmer might be able to fairly-easily and mindlessly create a first cut by cloning an existing language class similar to his desired language, then get help from a experienced programmer and sample outputs to refine the algorithm.