Round

See Also: Math Functions, Integer, Number, Real

Purpose

Round returns a LongPtr value from a variable of another numeric type by rounding the decimal portion.

Return Type

LongPtr

Syntax

(Round( {expression} ))

What It Does

Round returns {expression} rounded to the nearest LongPtr value. When the decimal portion of the {expression} is .5 or more it is rounded up, otherwise it is rounded down.

Move (Round(8.3782)) to lpSample

In this example, the value 8 is moved to iSample.

Round rounds negative numbers whose decimal value exceeds 0.5 downward.

Move (Round(-6.6)) to lpSample

In this example, the value -7 is moved to iSample.

Notes

Move (3.14 * Round(nMean)) to lpResult

This example would output 3.14 times the rounded value of number variable nMean to LongPtr variable lpResult in the full precision of number variables.