CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Numbers > Banker's rounding

Banker's rounding

When you add rounded values together, always rounding .5 in the same direction results in a bias that grows with the more numbers you add together. One way to minimize the bias is with banker's rounding.

Banker's rounding rounds .5 up sometimes and down sometimes. The convention is to round to the nearest even number, so that both 1.5 and 2.5 round to 2, and 3.5 and 4.5 both round to 4. Banker's rounding is symmetric.

In CitectVBA, the CByte(), CInt(), CLng(), CCur(), and Round() numeric functions perform banker's rounding.