Instant properties: round

The instant property round represents the rounded value of the given float operand.

Declaration

float float.round

Discussion

The instant property round returns a rounded value by calculating the next lowest or highest integer value of the operand in context of which the property is evaluated. Please note, the instant property round is read-only. The write access to this property is not allowed. For example:

var float f1 = 11.3; var float f2 = -5.3; var float result1 = f1.round; // result1 = 11.0 var float result2 = f2.round; // result2 = -5.0 // Write access is not allowed f1.round = 10.0; // Chora Compiler error

See also the built-in function math_round() as well as the cognate instant properties floor, ceil, trunc and fract.