OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


TRUNC



 >>---TRUNC(number -+-----+-)------><
                    +-,n--+

TRUNC returns the integer part of number, and n decimal places. The 
default n is zero, and it returns an integer with no decimal point. If you 
specify n, it must be a nonnegative whole number. The number is first 
rounded according to standard REXX rules, just as though the operation 
number+0 had been carried out. The number is then truncated to n decimal 
places (or trailing zeros are added if needed to make up the specified 
length). The result is never in exponential form. 
Here are some examples: 
TRUNC(12.3)           ->    12
TRUNC(127.09782,3)    ->    127.097
TRUNC(127.1,3)        ->    127.100
TRUNC(127,2)          ->    127.00

Note:    The number is rounded according to the current setting of NUMERIC 
         DIGITS if necessary before being processed by the function. 
   

Inf-HTML End Run - Successful