Skip to content

Round - Built-in Arithmetic Function

Purpose

Round returns a rounded number.

Syntax

Round(num [,exp] [,type])

Arguments

Argument Required Description
num Yes Any numeric expression. The number to be rounded.
exp No Any numeric expression. The number of decimals included in the rounding.
type No One of the rounding constants.

Returns

Variant with numeric value

Example

Return Round(32.445)                         // returns 32
Return Round(32.445, 2)                      // returns 32.44
Return Round(32.445, 2, drRoundHalfUp)       // returns 32.45
Return Round(32.445, 2, drRoundHalfToEven)   // returns 32.44

Notes

  • When num cannot be converted to a number, a runtime error is generated.