See Also: Math Functions, Integer, Number, Real
Round returns a LongPtr value from a variable of another numeric type by rounding the decimal portion.
(Round( {expression} ))
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.
When used inside an expression, round affects only the precision of its own expression, not that of the evaluation of the overall expression.
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.