Bernard,
Try following:
set var agrs = (format(.igrs,"[-]00000000000"))
This will still give you a 12 character field but the space
will be on the right.
You then can use the LN2 syntax below to accomplish what
you wish.
--
Jim Bentley
American Celiac Society
[EMAIL PROTECTED] - email
(973) 776-3900 x5029 - voicemail/fax
---- "Bernard Lis" <[EMAIL PROTECTED]> wrote:
> In the following code, I want to put 2 currency amounts
> into a text line, right justified and zero filled. The
> fields are 11 spaces each.
> The first amount should go into 1 thru 11 and the second
> amount should go into 12 thru 22.
>
> However, it seems that the format function is putting a
> sign field in front of the digits and therefore truncating
> the last digit.
>
> Anyone know how I can eliminate the extra space in front
> of the amounts?
>
> set echo on
>
> set var gross curr = 35,123.45
>
> set var ftax curr = 2,345.56
>
> set var igrs int = (.gross * 1000/10)
>
> set var itax int = (.ftax * 1000/10)
>
> set var agrs = (format(.igrs,"[>]00000000000"))
>
> set var atax = (format(.itax,"[>]00000000000"))
>
> set var ln = " "
>
> set var ln = (sput(.ln,.agrs,1))
>
> set var ln = (sput(.ln,.atax,12))
>
> set var ln2 = " "
>
> set var ln2 = (smove(.agrs,1,11,.ln2,1))
>
> set var ln2 = (smove(.atax,1,11,.ln2,12))
>
> write .ln
>
> write .ln2
>
> set var ln3 = " "
>
> set var ln3 = (smove("ABCDE",1,5,.ln3,1))
>
> set var ln3 = (smove("fghij",1,5,.ln3,6))
>
> write .ln3
>
> set echo off
>
> return
>
>
__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l