Important: The information in this document is obsolete and should not be used for new development.
FixRound
You can use theFixRound
function to round a fixed-point number to the nearest integer.
FUNCTION FixRound (x: Fixed): Integer;
x
- The
Fixed
number to be rounded.DESCRIPTION
TheFixRound
function returns theInteger
number nearest theFixed
number you supply in thex
parameter. If the value is halfway between two integers (0.5), it is rounded up. Thus, 4.5 is rounded to 5, and -3.5 is rounded to -3.To round a negative
Fixed
number so that values halfway between two integers are rounded to the number with the higher absolute value, negate the number, round it, and then negate it again.