round Function

Rounds a real number to the nearest multiple of another real number.


real round(real _arg, real _decimals)

Parameter

Description

_arg

The original number.

_decimals

The number that _arg should be a multiple of.

The number that is a multiple of _decimals that is closest to _arg.

To round of a real number to a specified number of decimal places, use the decround function.

// Returns the value 125.00.
round(123.45,5.00);
 
// Returns the value 7.35.
round(7.45,1.05);

Community Additions

ADD
Show: