Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).


Returns a number rounded to a specified number of decimal places.




expression The numeric expression being rounded.
numdecimalplaces Optional — Number indicating how many places to the right of the decimal are included in the rounding. If omitted, expression rounded to an integer is returned.


The Round function always rounds the number 5 up. Leading and trailing zeros are deleted.

Round returns expression rounded to:

  • An integer if the numdecimalplaces argument is omitted, or specified as 0, the empty string (""), or a negative number.

  • The specified number of decimal places (excluding trailing zeros). A fractional value for numdecimalplaces is truncated to an integer.

  • The actual number of decimal places (excluding trailing zeros) if the numdecimalplaces argument is greater than or equal to the actual number of decimal places


The following example uses the Round function to round a number to three decimal places:

Dim MyVar, pi
pi = 3.14159
MyVar = Round(pi,3) ' MyVar contains 3.142.
Println MyVar

See Also