Round()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

Round()

Syntax

Round( <NumericValue>, <Number Of Decimals> )

 

Purpose

To round a numeric value to a specified number of digits.

 

Parameters

<NumericValue> is the number to round.

 

<NumberOfDecimals> is the number of decimal places to retain. Specifying a negative <NumberOfDecimals> value rounds whole number digits.

 

Returns

<NumericValue> rounded to <NumberOfDecimals>.

 

Usage

Round() is a numeric function that rounds <NumericValue> to the number of places specified by <NumberOfDecimals>. Specifying a zero or negative value for <NumberOfDecimals> allows rounding of whole numbers. A negative <NumberOfDecimals> indicates the number of digits to the left of the decimal point to round. Digits between five to nine, inclusive, are rounded up. Digits below five are rounded down.

 

Example

The following examples illustrate Round():

 

CALL

RESULT

Round( 10.4, 0 )

10.00

Round( 10.5, 0 )

11.00

Round( 10.51, 0 )

11.00

Round( 10.49999999999999, 2 )

10.50

Round( 101.99, -1 )

100.00

Round( 109.99, -1 )

110.00

Round( 109.99, -2 )

100.00