Script functions reference > Script functions in alphabetical order > R > Round

Round
Syntax
Round(num, decimals);
num
decimals
Description
Returns the first argument rounded to the number of decimals specified in the second argument.
This scripting function works for all numbers with a finite binary representation. The round half away from zero tie-breaking method is used. The scripting function returns the first argument (num) rounded to the number of decimals in the second argument (decimals). If the decimal is negative, the digits to the left of decimal separator are rounded. For example:
round(12.34, 0) = 12
round(12.3456, 2) = 12.35
round(1234.56, -2) = 1200
Note:
Returns
A number.
Example
$a=12.5567;
$b=round($a,2);
 
Result:
$b=12.56
OpenText StreamServe 5.6.2 Updated: 2018-01-26