rounded

rounded(): Integer;

The rounded method of the Real primitive type returns an integer containing the rounded value of the receiver.

The following code fragments show the use of the rounded method.

while count > 0 do
    tbl.rowHeight[count] := (tbl.height / tbl.rows).rounded;
    count := count - 1;
endwhile;

write (6.4).Real.rounded;   // outputs 6 [0,1,2,3,4 are rounded down]
write (6.5).Real.rounded;   // outputs 7 [5,6,7,8,9 are rounded up]

write (-6.4).Real.rounded;  // outputs -6 [0,1,2,3,4 are rounded up]
write (-6.5).Real.rounded;  // outputs -7 [5,6,7,8,9 are rounded down]