I wish that this Check Print Amount routine were standard MV-issue instead
of home grown.

On that topic, there is a user exit for converting a number to a roman
numeral. For sales reports to the branch offices in Italy.

My 1 cent.
----- Original Message -----
From: "Bruce Nichol" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Thursday, January 05, 2006 12:12 AM
Subject: Re: [U2] Converting number to word


> Goo'day, David,
>
> Dick Pick's gift to the world:
>
> At 15:24 05/01/06 +1100, you wrote:
>
> >Happy New Year,
> >
> >A current project involves printing a number string in its alphabetic
> >description e.g. 1 = one, 3 = three, 11 = eleven etc etc. The precise
task
> >is printing a label of book information and in this case the label is
> >"edition" e.g. first/second.
> >
> >The universe basic manual does not appear to provide a conversion code as
> >in "MCN...." etc ; would someone know of a UV code or algorithm that
> >converts these strings?
> >
> >Regards
> >
> >David Knight
> >-------
> >u2-users mailing list
> >u2-users@listserver.u2ug.org
> >To unsubscribe please visit http://listserver.u2ug.org/
>
>
> Just add "TH" to everything above "THREE" and replace ONe TWO THREE with
> FIRST SECOND THIRD... (I think)
>
> And discard the cents!
>
>
> 0001: SUBROUTINE(N,S)
> 0002: S= ''; IF NUM(N) ELSE RETURN
> 0003: N = N'R26%12'
> 0004: FOR I = 1 TO 7 STEP 3
> 0005:  X = N[I,3]
> 0006:  SX = ''
> 0007:  IF X > 99 THEN SX = SX:' ':FIELD('ONE TWO THREE FOUR FIVE SIX SEVEN
> EIGHT
>   NINE',' ',X[1,1]):' HUNDRED'
> 0008:  X = X[2,2]
> 0009:  IF X > 0 AND SX # '' THEN SX = SX:' &'
> 0010:  IF X > 0 AND SX = '' AND S# '' THEN SX = ' &'
> 0011:  IF X > 19 THEN SX = SX:' ':FIELD(' TWENTY THIRTY FORTY FIFTY SIXTY
> SEVENTY EIGHTY NINTY',' ',X[1,1]); X = X[2,1]
> 0012:  IF X >  0 THEN SX = SX:' ':FIELD('ONE TWO THREE FOUR FIVE SIX SEVEN
> EIGHT NINE TEN ELEVEN TWELVE THIRTEEN FOURTEEN FIFTEEN SIXTEEN SEVENTEEN
> EIGHTEEN NINETEEN',' ',X)
> 0013:  IF SX # '' THEN S = S:SX:FIELD(' MILLION... THOUSAND','.',I)
> 0014: NEXT I
> 0015: IF S = '' THEN S = 'ZERO'
> 0016:  IF S = ' ONE' THEN TEXT = ' DOLLAR ' ELSE TEXT = ' DOLLARS '
> 0017: S = S:TEXT
> 0018: IF N[11,2] = 0 THEN
> 0019:  S = S:'ONLY'
> 0020: END ELSE
> 0021:  IF N[11,2] > 9 THEN
> 0022:   S = S:N[11,2]:'/100'
> 0023:  END ELSE
> 0024:   S = S:'& ':N[11,2]+0:' CENT'
> 0025:   IF N[11,2] > 1 THEN S= S:'S'
> 0026:  END
> 0027: END
> 0028: RETURN
>
>
>
>
>
> >--
> >No virus found in this incoming message.
> >Checked by AVG Anti-Virus.
> >Version: 7.1.371 / Virus Database: 267.14.12/220 - Release Date: 03/01/06
>
> Regards,
>
> Bruce Nichol
> Talon Computer Services
> ALBURY        NSW     2640
> Australia
>
> http://www.taloncs.com.au
>
> Tel: +61 (0)411149636
> Fax: +61 (0)260232119
>
> If it ain't broke, fix it till it is!
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.1.371 / Virus Database: 267.14.12/220 - Release Date: 03/01/06
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to