Welcome

Welcome, thanks to look my blog

Tuesday 8 December 2015

Rounds a floating point number to an integer

Description
The Round function rounds a floating point Number to an Integer value.

The rounding uses Bankers rules, where an exact half value causes a rounding to an even number:

12.4 rounds to 12
12.5 rounds to 12 // Round down to even
12.6 rounds to 13
13.4 rounds to 13
13.5 rounds to 14 // Round up to even
13.6 rounds to 14
Notes
The Trunc function does the same, but returns the integer in an Integer value.
Related commands
FracThe fractional part of a floating point number
IntThe integer part of a floating point number as a float
TruncThe integer part of a floating point number

sumber : http://www.delphibasics.co.uk/RTL.asp?Name=Round

No comments:

Post a Comment