ROUND( ) function

Returns a rounded whole number for a numeric value.

Syntax

ROUND(number)

Parameters

Name Type Description
number numeric

The value to round to the nearest integer.

Output

Numeric.

Examples

Basic examples

Returns 7:

ROUND(7.2)

Returns 8:

ROUND(7.5)

Returns -8:

ROUND(-7.5)

Advanced examples

Rounding monetary values

Creates a field that is equal to the balance rounded to the nearest dollar value:

DEFINE FIELD Nearest_dollar_value COMPUTED ROUND(Balance)

Remarks

How it works

ROUND( ) returns a number equal to the number value rounded to the nearest integer.

Rounding behavior Positive values Negative values
Rounds up to the next integer

>= 0.5

ROUND(1.50) = 2

>= 0.5

ROUND(-1.50) = -2

Rounds down to the next integer

< 0.5

ROUND(1.49) = 1

< 0.5

ROUND(-1.49) = -1

Rounding to a particular number of decimal places

If you want to round a number to a particular number of decimal places, use the DEC( ) function. The ROUND( ) function is the same as the DEC( ) function with zero decimal places specified.

ROUND(number)

is equivalent to:

DEC(number, 0)