ROUND

Syntax

ROUND (numeric_expression, value )

Description

Returns a numeric value, rounded to the specified length or precision.

Arguments

numeric_expression A number that can be converted to a Double64 number.
value The precision, expressed as an integer, to which to round the numeric_expression.

— If value is positive, the numeric_expression is rounded to the specified number of decimal positions.

— If value is negative, numeric_expression is rounded to the specified length on the left side of the decimal point.

Returns

A numeric value in Double64 format. A Double32 or Double64 data type represents a 32- or 64- double-byte floating-point number.

Remarks

Using ROUND with Decimal data greater than 64 bits may result in a loss of precision.

Note: The ROUND function does not round as expected when the last digit is a 5, because this Microsoft function uses bankers rounding. For example ROUND(16.345) rounds to 16.34 instead of 16.35.

Decimal (128) data type is a decimal number with a maximum length of 128 bits.

Note: Many functions return a numeric value smaller than the maximum length of decimal. If your data is longer than 32 bits, make sure you understand what the return value is. Any extra digits are truncated.

Example

If MyEntity.Amount contains a value of 100.66:

ROUND(MyEntity.Amount, 1)

Returns: 100.7

Related Topics

Data Conversion

Math Functions

CEILING

FLOOR