Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > R

RNDDOWN

Scroll Prev Top Next More

(RNDDOWN(arg1, arg2))

 

Returns a number rounded down 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 down after the decimal point

 

Remarks:

 

RNDDOWN behaves like ROUND, except that it always rounds a number down.

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

If digits is 0, then number is rounded down to the nearest integer.

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

 

Examples

 

 Example 01:

 

SET VAR v1 DOUBLE = (RNDDOWN(662.79,0))

SHOW VAR v1

662

 

 Example 02:

 

SET VAR v2 DOUBLE = (RNDDOWN(662.79, 1))

SHOW VAR v2

662.7

 

 Example 03:

 

SET VAR v3 DOUBLE = (RNDDOWN(54.1, -1))

SHOW VAR v3

50

 

 Example 04:

 

SET VAR v4 DOUBLE = (RNDDOWN(55.1, -1))

SHOW VAR v4

50

 

 Example 05:

 

SET VAR v5 DOUBLE = (RNDDOWN(-23.67, 1))

SHOW VAR v5

-23.6