Page 1 of 1

Convert number 1234 to One Thousand Two Hundred Thirty Four

Posted: Wed Feb 11, 2009 8:12 am
by Eric
The following command will convert ANY numeric value to its English equivalent. For instance, if you have a field that contains the number 773, this command will fill into a different field: Seven Hundred Seventy Three Dollars And No Cents or Seven Hundred Seventy Three (more on that option at the end of the instructions).

In order for this command to work, the number field in your database must be a numeric type field (pull down the Edit menu to Fields to check on this).

1. Download and unzip the attached program to the root level of the AccuZIP6 5.0 folder.
2. Open AccuZIP6 5.0 and a Database that contains the numeric value to convert.
3. From the Edit menu, choose Fields.
4. Create a Character Field that will hold the English words for the number, such as “EnglishVal” and make it 254 characters.
5. Save the changes and pull down the Edit menu to Command…
6. Give your command a new name, e.g., Convert Currency to English
7. Type the following command syntax into the large box.

Code: Select all

REPLACE ALL EnglishVal with ConvertCurrencyToEnglish(NumericFieldName)
Note: NumericFieldName is name of the NUMERIC Type Field that contains the number, e.g., 1234.56. The field must be Numeric type.

8. Click Run!

If you want to remove the words Dollars And No Cents from the field, then run this command instead:

Code: Select all

REPLACE ALL EnglishVal with ConvertCurrencyToEnglish(NumericFieldName)
Replace All EnglishVal With STRTRAN(EnglishVal,"Dollars And No Cents","")