How rounding works
Pick the step you're rounding to, like 0.01 for two decimal places. The number falls between two multiples of that step. Rounding picks one of them, and the rule decides which.
With the usual half up rule: look at the part you're dropping. Less than half a step rounds down, half or more rounds up (away from zero for negative numbers). So 2.345 to two places is 2.35, and −2.345 is −2.35.
Worked example: 1.005 to two decimal places
The step is 0.01. 1.005 sits exactly halfway between 1.00 and 1.01, so it's a tie, and half up gives 1.01. Many spreadsheet and programming functions show 1.00, because the computer stores 1.005 in binary as 1.00499999999999989…, which is just under halfway. Calcist rounds the exact decimal you typed, so ties are treated as ties.
The rounding rules compared
| Rule | 2.5 | 3.5 | −2.5 | 2.6 | Used for |
|---|---|---|---|---|---|
| Half up | 3 | 4 | −3 | 3 | School math, Excel ROUND |
| Half to even (banker's) | 2 | 4 | −2 | 3 | Science and finance, to avoid bias |
| Half down | 2 | 3 | −2 | 3 | Rare; ties toward zero |
| Half toward +∞ | 3 | 4 | −2 | 3 | JavaScript Math.round |
| Always up (ceiling) | 3 | 4 | −2 | 3 | Boxes or buses needed |
| Always down (floor) | 2 | 3 | −3 | 2 | Whole years of age |
| Toward zero (truncate) | 2 | 3 | −2 | 2 | Cutting off digits |
Banker's rounding sends ties to the even neighbor, so over many numbers, half the ties go up and half go down. That keeps totals from drifting upward.
Significant figures and fractions
- Significant figures count from the first nonzero digit. 0.0012345 to 3 significant figures is 0.00123; 98,765 to 2 is 99,000.
- Nearest fraction is handy for measurements: 3.14159 inches to the nearest 1/8 is 3 1/8 (3.125).
When this doesn't apply
- Money rules can differ: some taxes and payroll systems require a specific rounding rule. Check what your system uses.
- Round once, at the end. Rounding in the middle of a calculation adds up errors.
- Numbers can have up to 1,000 digits; results longer than 60 characters are shown in scientific notation.