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 18.

Returns

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

Example 1

This statement returns 9.62:

Round(9.624, 2)

Example 2

This statement returns 9.63:

Round(9.625, 2)

Example 3

This statement returns 9.600:

Round(9.6, 3)

Example 4

This statement returns –9.63:

Round(-9.625, 2)

Example 5

This statement returns null:

Round(-9.625, -1)

See also