The "algorithm" refers to the manner in which the amount is broken down into separate phrases. For example, when the number 21 is to be spoken, the algorithm for English has to select the phrase for twenty followed by the phrase for one. The German algorithm is completely different: it has to select ein for the 1, followed by und and then zwanzig for the 20 part. The following section describes how to code the algorithm for specific applications.

There are three main inputs to the algorithm: the string to be decoded (usually a number) and the prefix and suffix codes. Input strings are also analyzed into an integer part and decimals part which are available separately to your algorithm. The prefix and suffix codes are normally used to select an introduction such as you have entered. The default code value is 1; if you have coded a prefix or suffix in your algorithm you will need to specify a zero prefix or suffix code to suppress it.

The use of indexed tables of prefixes and suffixes allows the same amount file to be used for more than one purpose. You could use the same file to say:

Prefix:You have


Prefix:There are
Suffix:items in stock