Choosing what to round to
First decide where the cut falls. The calculator offers three targets:
- Decimal places count digits after the decimal point: 3.14159 to 4 places is 3.1416. Typing 2 places for a whole number such as 5 gives 5.00, because the zeros state the precision.
- Significant figures count digits from the first nonzero one, wherever the decimal point is. This suits measurements and scientific values, where the size of the number varies but the precision does not.
- Nearest multiple rounds to a step of your choice, such as 0.05 for cash, 0.25 for quarter hours or 25 for a price band.
Seven rounding modes compared
The mode decides what happens to the digits you drop. The three half modes go to the nearer candidate and differ from each other only on an exact tie, a number exactly halfway between two candidates; the other four always push in one direction. Below the main answer, the calculator lists your number rounded under all seven modes. Here are the same inputs through every mode, with 2.45 rounded to one decimal place and the others to whole numbers:
| Mode | 2.5 | 3.5 | −2.5 | 2.45 | −2.7 |
|---|---|---|---|---|---|
| Half up (away from zero) | 3 | 4 | −3 | 2.5 | −3 |
| Half to even (banker’s) | 2 | 4 | −2 | 2.4 | −3 |
| Half down (toward zero) | 2 | 3 | −2 | 2.4 | −3 |
| Up (away from zero) | 3 | 4 | −3 | 2.5 | −3 |
| Down (toward zero, truncate) | 2 | 3 | −2 | 2.4 | −2 |
| Ceiling (toward +∞) | 3 | 4 | −2 | 2.5 | −2 |
| Floor (toward −∞) | 2 | 3 | −3 | 2.4 | −3 |
Half up is the school rule: from 5 onward, round away from zero. Half to even sends a tie to whichever neighbor ends in an even digit, so 2.5 and 3.5 go to 2 and 4. Over many values, ties then go up about as often as down, and totals do not drift upward. NIST Special Publication 811 (Appendix B, section B.7.1) gives this rule for discarding a 5 followed only by zeros, and IEEE 754 makes it the default rounding for binary floating-point results.
Up and down ignore how close the number is and only look at the direction relative to zero; down is the same as cutting off digits (truncating). Ceiling and floor look at the number line instead, which is why they differ from up and down only for negative numbers: −2.7 truncates to −2 but floors to −3.
In the multiple formula, “even” in half to even applies to the number of steps, not to the last digit: 112.5 to the nearest 25 is 4.5 steps, which goes to 4 steps (100).
Why 1.005 can round to 1.00 in other software
Most programming languages, and spreadsheets in their underlying storage, hold numbers in binary floating-point as described by IEEE 754. Binary cannot store 1.005 exactly; the closest value it can hold is 1.00499999999999989…, just under the halfway point. Rounding that stored value to two places correctly gives 1.00. In JavaScript, (1.005).toFixed(2) returns “1.00”, and Python’s round(1.005, 2) returns 1.0. Some spreadsheets apply their own corrections, so results vary from program to program.
This calculator never converts your number to binary. It reads the digits you typed and rounds them as decimal digits, so 1.005 to two places is 1.01 with half up, and 2.675 is 2.68.
Significant figures and leading zeros
Leading zeros only place the decimal point, so they are never significant. 0.004567 has four significant figures (4, 5, 6, 7), and rounding to two gives 0.0046. Zeros after the last nonzero digit of a decimal do count: 0.0500 has three. Section 7.9 of the same NIST guide defines a significant digit as one required to express the numerical value, and points out that the trailing zeros of 1200 are ambiguous while those of 1.200 km are not.
Rounding can carry into a new digit. 9.996 to three significant figures becomes 10.0, which still shows three figures.
Worked examples
- The first nonzero digit is in the thousands place, so two figures keep the thousands and hundreds.
- The dropped part starts with 3, below 5, so round down: 1200.
- Write it as 1.2 × 10³ if you need to make clear that the zeros are not significant.
- 4.13 ÷ 0.05 = 82.6 steps.
- Rounded to the nearest whole number of steps: 83.
- 83 × 0.05 = 4.15.
- 112.5 ÷ 25 = 4.5, an exact tie between 4 and 5 steps.
- Half up takes 5 steps: 125.
- Half to even takes the even count, 4 steps: 100.
Cash rounding to 0.05
In Canada, the Royal Canadian Mint stopped distributing pennies after February 4, 2013. The rounding guideline published by the Department of Finance with Budget 2012 applies only to cash payments, and only to the final amount, after taxes and fees have been added exactly. That amount goes to the nearest five cents: totals ending in 1 or 2 cents round down to 0, 3 and 4 round up to 5, 6 and 7 round down to 5, and 8 and 9 round up to 10. Cheque, debit and credit card payments are not rounded. Since totals are whole cents, an exact tie cannot occur, and rounding to the nearest multiple of 0.05 in any of the three half modes gives the guideline’s result.
Rounding traps
- Rounding twice. 2.449 to one place is 2.4. Rounding first to 2.45 and then to one place gives 2.5. Always round once, from the original number.
- Rounding before adding. Round each line of a bill and the total may differ by a cent or more from the rounded total. Keep full values until the last step, as the Canadian guideline does with taxes.
- “Round down” with negative numbers. Toward zero, −3.7 becomes −3; toward −∞ it becomes −4. Choose down or floor deliberately.
- Dropping meaningful zeros. 2.50 m and 2.5 m are the same length but not the same precision. Keep the zeros the rounding produces.
Rounding to decimal places treats a tie as exact only if the dropped digits are a 5 followed by zeros. 1.0051 is past halfway, so it rounds to 1.01 in every half mode.
Sources
- NIST Guide to the SI, Appendix B (B.7, Rules for rounding numbers and converted numerical values of quantities), National Institute of Standards and Technology.
- NIST Guide to the SI, Chapter 7 (7.9, Choosing SI prefixes, on significant digits), National Institute of Standards and Technology.
- Budget 2012, Eliminating the penny (archived), Department of Finance Canada.
- IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic, IEEE Standards Association.