Round

Description

Rounds a number to the specified number of decimal places.

Syntax

Round ( x, n )

Argument

Description

x

The number you want to round.

n

The number of decimal places to which you want to round x. Valid values are 0 through 30.


Return value

Decimal. Returns x rounded to the specified number of decimal places if it succeeds, and null if it fails or if any argument's value is null.

Examples

This statement returns 9.62:

Round(9.624, 2)

This statement returns 9.63:

Round(9.625, 2)

This statement returns 9.600:

Round(9.6, 3)

This statement returns -9.63:

Round(-9.625, 2)

This statement returns null:

Round(-9.625, -1)

See also

Ceiling

Init (obsolete)

Truncate

Round method for DataWindows in the section called “Round” in DataWindow Reference.