MIDRANGE dot COM Mailing List Archive



Home » RPG400-L » December 2005

Re: Round/Truncate in RPG &RPGLE



fixed

Rob,

In this case just a straight add or subtract.   The first  field has 2 
decimals and the one being added to (or subtracted from) has no decimals

ie:  ADD       NET$          TRUNCK           11 0  (where NET$ is  13 2)

Even tried doing:

NET$          MULT   -1                  POS                13 2 
                     SUB       POS           TRUNCK 

and we get the same results.  If we do a half-adjust on the MULT then it 
works as expected (less than .50 it drops the decimals >= .50 then rounds 
up) or if we define POS as 13 0 this also works (it drop the decimals), 
but on this I would expect it to ignore the decimals on the subtract and 
it doesn't.

Regards,
-- Jim

>how does one "do truncation"?  Are you MOVEing the field from the one 
>field to the other?  Are you using z-add?  Are you using eval?
>
>Rob Berendt





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact