× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Converting numbers to words
  • From: "Art Tostaine, Jr." <atostain@xxxxxxxxxxx>
  • Date: Tue, 18 Nov 1997 13:48:44 -0500
  • Organization: Creative Computer Associates, Inc.

Leland, David wrote:

> Does anyone have a tried and tested RPG program for converting a number
> to it's equivalent in words - for printing on checks ($1,234.56 = One
> thousand two hundred thirty-four and 56 cents).
>
> Thanks,
> Dave
> +---

This is one I have.  It accepts 7 digits alpha, but assumes 5.2 numeric.  It can
handle up to $99,999.99

    ¸ *¹            Unpublished- All Rights Reserved          ¸  ·
    ¸ *¹          (C) Creative Computer Associates,Inc.       ¸  ·
    ¸ *¹                          1992                        ¸  ·
    ¸ *·CHKWRDR   -Convert Amount to Words                    ¸  ·
    ¸ *                                                          ·
     E                    A       1 108 14
     IDATA01      DS
     I                                        1   70NUMBER
     I                                        1   20THO
     I                                        3   30HUN
     I                                        4   50DOL
     I                                        6   7 CEN
     C           *ENTRY    PLIST
     C                     PARM           WKNUM   7
     C                     PARM           WK08   90
     C                     MOVELWKNUM     NUMBER  70
     C                     MOVEL*BLANKS   WK08
     C**
     C** GET THOUSAND AMOUNT
     C**
¸B01·C           THO       IFNE 0
 ¸01·C           A,THO     CAT  A,102:1   WK01   30
¸E01·C                     END
¸B01·C           HUN       IFNE 0
 ¸01·C           WK01      CAT  A,HUN:1   WK02   60
 ¸01·C           WK02      CAT  A,101:1   WK03   60
¸X01·C                     ELSE
 ¸01·C                     MOVELWK01      WK03
¸E01·C                     END
     C**
     C** GET DOLLARS AMOUNT.  IF 0, STILL ADD "DOLLARS"
     C**
¸B01·C           DOL       IFNE 0
 ¸01·C           WK03      CAT  A,DOL:1   WK04   60
 ¸01·C           WK04      CAT  A,100:1   WK05   60
¸X01·C                     ELSE
¸B02·C           NUMBER    IFGT 1.00
 ¸02·C           WK03      CAT  A,100:1   WK05   60
¸E02·C                     END
¸E01·C                     END
     C           WK05      CAT  CEN:1     WK07   90
     C           WK07      CAT  'CENTS':1 WK08
     C                     MOVE *ON       *INLR
     C                     RETRN
**
ONE
TWO
THREE
FOUR
FIVE
SIX
SEVEN
EIGHT
NINE
TEN
ELEVEN
TWELVE
THIRTEEN
FOURTEEN
FIFTEEN
SIXTEEN
SEVENTEEN
EIGHTEEN
NINETEEN
TWENTY
TWENTY-ONE
TWENTY-TWO
TWENTY-THREE
TWENTY-FOUR
TWENTY-FIVE
TWENTY-SIX
TWENTY-SEVEN
TWENTY-EIGHT
TWENTY-NINE
THIRTY
THIRTY-ONE
THIRTY-TWO
THIRTY-THREE
THIRTY-FOUR
THIRTY-FIVE
THIRTY-SIX
THIRTY-SEVEN
THIRTY-EIGHT
THIRTY-NINE
FORTY
FORTY-ONE
FORTY-TWO
FORTY-THREE
FORTY-FOUR
FORTY-FIVE
FORTY-SIX
FORTY-SEVEN
FORTY-EIGHT
FORTY-NINE
FIFTY
FIFTY-ONE
FIFTY-TWO
FIFTY-THREE
FIFTY-FOUR
FIFTY-FIVE
FIFTY-SIX
FIFTY-SEVEN
FIFTY-EIGHT
FIFTY-NINE
SIXTY
SIXTY-ONE
SIXTY-TWO
SIXTY-THREE
SIXTY-FOUR
SIXTY-FIVE
SIXTY-SIX
SIXTY-SEVEN
SIXTY-EIGHT
SIXTY-NINE
SEVENTY
SEVENTY-ONE
SEVENTY-TWO
SEVENTY-THREE
SEVENTY-FOUR
SEVENTY-FIVE
SEVENTY-SIX
SEVENTY-SEVEN
SEVENTY-EIGHT
SEVENTY-NINE
EIGHTY
EIGHTY-ONE
EIGHTY-TWO
EIGHTY-THREE
EIGHTY-FOUR
EIGHTY-FIVE
EIGHTY-SIX
EIGHTY-SEVEN
EIGHTY-EIGHT
EIGHTY-NINE
NINETY
NINETY-ONE
NINETY-TWO
NINETY-THREE
NINETY-FOUR
NINETY-FIVE
NINETY-SIX
NINETY-SEVEN
NINETY-EIGHT
NINETY-NINE
DOLLARS AND
HUNDRED
THOUSAND


--
Art Tostaine, Jr.
Creative Computer Associates, Inc.
Parlin, NJ
atostaine_at_crecomp_dot_com


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.