07-20-2008, 06:04 AM
Internally it just calls Windows API function VarR8Round. I don't know why VarR8Round rounds 0.5 to the nearest even number. Maybe it is better in certain cases. For example, if you do many Round with money, and everytime 0.5 would be rounded up, and then add all, then the final result (sum) would be too big. Now, when in ~50% cases it rounds up and in ~50% cases rounds down, the final result (sum) is more correct.
For example. With your numbers. Without Round the sum is 40.5. With Round it is 40. Now calculate how much it would be if Round rounds 0.5 only up or only down.
For example. With your numbers. Without Round the sum is 40.5. With Round it is 40. Now calculate how much it would be if Round rounds 0.5 only up or only down.