Round

Use this function to round a number to the nearest specified decimal point and return the result.

Syntax

Round (Number, Places)

Parameter

Description

Number

Enter a valid numeric value with decimals. The default is the value of the current field.

Places

Enter the number of decimal places you want. The default is two (2).

The system returns the string value of a decimal number rounded to the number of places specified.

The sign of the number is not changed. Decimal numbers maintain up to 14 digits of precision. The Round function returns the value with or without trailing zeros requested. If you use the result the Round function returns in a mathematical equation or to represent a decimal parameter, the string is implicitly converted as needed.

Example

Here are some examples:

(Assume the current field value is 23.5473)

Function

Result

Explanation

Round ( )

23.55

Defaults to the current field and to two decimal places.

Round ( , 3)

23.547

Defaults to the current field and uses three decimal places.

Round (101.999, 0)

102

Rounds the given value to zero decimal places.

Round (101.999, 4)

101.9990

Rounds the given value to four decimal places.

Note When using the result of the Round function to assign a section field value, make sure the numeric field is defined without a format. If the field has a format, it may override the text provided by this function.

See also