Welcome Guest | My Membership | Login

Numeric to Alpha Translation

Downloads

Article

The attached subroutine will convert a numeric values to their alphabetic values. The number "4" converts to "four"; "25" converts to twenty five, etc.  There is also an option that will allow you to change a numeric value into an alphabetic count.  For example, 4 converts to "forth", "25" converts to twenty-fifth.

This routine was originally written as a means of check-protection for an accounts payable check-writing program. As an additional safety measure to asterisk-protection, the amount of the check is spelled out in full. Thus, if the numbers become smudged, the alphabetic values will still be there for verification.

The subroutine "NUMBER.TO.ALPHA1" can be called from any program for any NUMERIC Dollars-Cents attribute.

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 product the following results:

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

 

The second format allows you to display the number is counted format.  The notice the change to the last argument from “0” to “1”:

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

This will product the following results:

NUMBER: 127.35
WORD: ONE HUNDRED AND TWENTY-SEVENTH AND THIRTY-FIVETH

 

# # #          # # #          # # #

 

Related Articles

  • Convert C#/VB.NET Date/Time to Internal Date

    This Article will show you how to convert a C# or VB.NET Date/Time object into an Internal MultiValue Date. It will show you how to do it using the ICONV functions, and well as how to generate an Internal Date without using the ICONV function.

  • Convert Internal Date into C#/VB.NET Date/Time

    This article will show how to convert a MultiValue (PICK) Internal Date into a DateTime object that you can use in C# and VB.NET. The article will cover how use the OCONV statement, as well as, how to generate the DateTime object without using the OCONV statement.

  • Numeric to Alpha Translation

    Database: D3, Advanced Pick, AREV, jBase, Mentor/PRO, mv*Base, mvEnterpise, OpenInsight, OpenQM, Reality, Ultimate, UniVerse, UniData, UniVision

    The attached subroutine will convert a numeric values to their alphabetic values. The number "4" converts to "four"; "25" converts to twenty five, etc. There is also an option that will allow you to change a numeric value into an alphabetic count. For example, 4 converts to "forth", "25" converts to twenty-fifth.


Return to top