ROUND function

The ROUND function allows us to control the rounding precision for a decimal expression. The syntax for the ROUND function is as follows:

DecimalResult := ROUND (Number [, Precision] [, Direction] )

Here, Number is rounded, Precision spells out the number of digits of decimal precision, and Direction indicates whether to round up, round down, or round to the nearest number. Some examples of Precision values follow:

If no Precision value is specified, the Rounding default is controlled by a value set in General Ledger Setup in the Appln. Rounding Precision field on the Application tab. If no value is specified, Rounding will default to two decimal places. If the precision value is, for example, .04 rather than .01, the rounding will be done to multiples of four at the number of decimal places specified.

The options available for the Direction value are shown in the following table:

Direction value (a text value) Rounding effect
= Round to the nearest (mathematically correct and the default)
> Round up
< Round down

Consider the following statement:

DecimalValue := ROUND (1234.56789,0.001,'<')

It would result in a DecimalValue containing 1234.567, whereas the following statements would both result in a DecimalValue containing 1234.568:

DecimalValue := ROUND (1234.56789,0.001,'=') 
DecimalValue := ROUND (1234.56789,0.001,'>')
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.75.165