Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > R

RNDUP

Scroll Prev Top Next More

(RNDUP(arg1, arg2))

 

Returns a number value rounded up to a specified number of digits. The resulting variable value will be a DOUBLE data type. arg2 must be an INTEGER value.

 

Where: arg1 is the value to be rounded

arg2 is the position to be rounded up after the decimal point

 

Remarks:

 

RNDUP behaves like ROUNDDWN, except that it always rounds a number up

If arg2 is greater than 0 (zero), then number is rounded up to the specified number of decimal places.

If arg2 is 0, then number is rounded up to the nearest integer.

If arg2 is less than 0, then number is rounded up to the left of the decimal point.

 

Examples:

 

Example 01:

 

SET VAR vRoundUp1 DOUBLE = (RNDUP(762.273735,2))

SHOW VAR vRoundUp1

762.28

 

Example 02:

 

SET VAR vRoundUp2 DOUBLE = (RNDUP(7796162.1455,-2))

SHOW VAR vRoundUp2

7796200.