Rounding
Round to a place or to a number of decimals, with the rule you are using named.
English
Rounded
In words:
The four rules
Rounding only becomes a decision when the value lands exactly halfway. These are the ways that decision is made, and they give different answers to the same question.
| Rule | What it does |
|---|---|
| Half away from zero | A half goes to the larger magnitude: 2.5 becomes 3 and -2.5 becomes -3. This is the rule taught in school. |
| Half to even | A half goes to whichever neighbour is even: 2.5 becomes 2 and 3.5 becomes 4. Also called banker's rounding, it is the default in IEEE 754 arithmetic and in the Round function of VBA, because it does not drift upwards over many sums. The ROUND function in Excel and Google Sheets does not use it: there a half goes away from zero. |
| Always down | Cut the digits off. 2.9 becomes 2. |
| Always up | Go to the next step whenever anything is left over. 2.1 becomes 3. |
Why not just use the computer's round function? Because some of them treat a half differently on each side of zero: JavaScript's Math.round turns 2.5 into 3 but -2.5 into -2. This tool rounds the size of the number and puts the sign back afterwards, so a half always goes the same way relative to zero.