int FloatToInt(float value, optional RoundDirection)
Converts the supplied floating point value into an integer.
This function is necessary because implicit conversions in the script are not supported.
RoundDirection can be either eRoundDown (the default), eRoundUp or eRoundNearest,
which specifies what direction to round the floating point number in.
Example:
Display("Round down: %d", FloatToInt(10.7));
Display("Round up: %d", FloatToInt(10.7, eRoundUp));
Display("Round nearest: %d", FloatToInt(10.7, eRoundNearest));
displays the integer value of 10.7, rounded in the three different ways.
See Also: IntToFloat
|