Tech Tip: Number to Word conversion

Some of your business processes are complex, some are simple. Let's look at check writing as an example. This is a really simple process, but you can run into one small snag.

When writing checks, you likely want to spell out the dollar amount that the check is for as an additional security feature.

$1023.23 = One Thousand Twenty-Three and Twenty-Three Cents.

There is no OCONV function that will do this for you, so this simple little program will likley come in handy:

NUMBER = "127.35"
CALL NUMBER.TO.ALPHA(NUMBER,INT.WORD,DEC.WORD,"0")
CRT "NUMBER: ": NUMBER
CRT "WORD: ": INT.WORD :" AND ": DEC.WORD :" CENTS"
END

This will produce the following results:

NUMBER: 127.35
WORD: ONE HUNDRED TWENTY-SEVEN AND THIRTY-FIVE CENTS

In addition to converting numbers into dollar formats, you may need to convert it into a alpha counting formats, such as:

NUMBER: 127.35
WORD: ONE HUNDRED TWENTY-SEVENTH POINT THIRTY-FIFTH

You can download the code for this subroutine from:

http://www.intl-spectrum.com/resource/173/Numeric_To_Alpha_Conversion.aspx IS

Do you have a Tech Tip to share? E-mail it to editor@intl-spectrum.com

Featured:

Mar/Apr 2014

menu
menu