RoundToMultiple (open)

Round a value to a multiple of a unit value

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION RoundToMultiple(VARIANT value, VARIANT roundunit, STRING mode)

Parameters

VARIANT value

Value to round

VARIANT roundunit

Multiple to round to. Must be the same type as the value to round

STRING mode

Rounding mode: 'none','toward-zero", 'toward-infinity', 'down', 'up', 'half-toward-zero', 'half-toward-infinity', 'half-down', 'half-up'

Return value

VARIANT

The rounded value