Previous page

Next page

Bankers' Rounding

Summary

PayGlobal uses a rounding algorithm called "bankers' rounding", which is also know as "statistician's rounding" or the "round-to-even method".

In traditional rounding:

  • If the number is less than the halfway value between the possible outcomes, then it is rounded down. For example, 0.3 is rounded down to 0.0.
  • If the number is halfway between the possible outcomes, then it is rounded up. For example, 0.5 is rounded up to 1.0.
  • If the number is greater than the halfway value between the possible outcomes, then it is rounded up. For example, 0.7 is rounded up to 1.0.

In bankers' rounding:

  • Numbers that are less than or greater than the halfway value are rounded the same as in traditional rounding.
  • Numbers that are halfway between the possible outcomes are sometimes rounded up and sometimes rounded down - the last digit is always rounded to the nearest even number.

Example

If you use bankers' rounding to round to two decimal places, then:

  • 12.345 is rounded down to 12.34 because the last rounded digit (4) is even.
  • 12.355 is rounded up to 12.36 because the last rounded digit (6) is even.

If 0.5 was always rounded up to 1.0, then the average error would be 0.5. Conversely, if 0.5 was always rounded down to 0.0, then the average error would be -0.5. In bankers' rounding, the average errors balance out because 0.5 is rounded up half the time and down half the time. Banker’s rounding minimises rounding errors as is shown below:

Number

Rounds to

Rounding Error

0.0

0.0

0.0

0.1

0.0

- 0.1

0.2

0.0

- 0.2

0.3

0.0

- 0.3

0.4

0.0

- 0.4

0.5

Nearest even
number

(Averages to zero)

0.6

1.0

0.4

0.7

1.0

0.3

0.8

1.0

0.2

0.9

1.0

0.1

 

Previous page

Next page