CompoundPage

Rounding Calculator

2.675 to two places is 2.68. Most software says 2.67. This rounding calculator works on the number you typed, not its binary approximation, and shows the digit that decides it.

Read exactly as typed. Commas are thousands separators; 1.5e-3 and 1.5 x 10^-3 are understood. Up to 60 digits.

Used when rounding to decimal places. 0 is a whole number, 1 is tenths, 2 is hundredths.

Used when rounding to significant figures.

The three half rules differ only on an exact tie. Truncate, ceiling and floor ignore how big the dropped part is.

Rounded to 2 decimal places2.68

Digits examined The last kept digit is in the hundredths place. The first dropped digit is 5 with nothing after it. A 5 and nothing after it is exactly half a step: a tie, and the only case where the half rules disagree.
keep 2.67 | drop 5
Between Exactly halfway.
2.67 and 2.68
Why this answer An exact tie. Half up sends ties toward +infinity, to 2.68.
Half up
What rounding the double gives 2.675 has no exact binary form. The nearest double is 2.67499999999999982236431605997495353221893310546875, and rounding that (as JavaScript's toFixed does, half away from zero) gives 2.67 where the exact number gives 2.68.
2.67
2.675 rounded to 2 decimal places under every rule
RuleResultWhy
Half up2.68tie: toward +infinity
Half to even2.68tie: to the even neighbor
Half away from zero2.68tie: away from zero
Truncate2.67drop excess, toward zero
Ceiling2.68always toward +infinity
Floor2.67always toward -infinity
  • Half up and half away from zero give the same answer for positive numbers and differ only on negative ties: -2.5 goes to -2 under half up and to -3 away from zero. Excel's ROUND function rounds half away from zero.
  • Half to even exists because the school rule is biased: rounding every tie up pushes a total of many rounded figures upward. Sending ties to the even neighbor cancels that out on average, which is why it is the IEEE 754 default and the rule for Python's round().

How the Rounding Calculator works

Rounding replaces a number with a nearby one that has fewer digits, and every rounding comes down to one decision: of the two candidates either side, which one? The candidates are the multiples of the step you are rounding to (hundredths, tens, eighths), and the number sits between two of them. Everything that follows is about how that choice is made. Rounding decimals to a number of places and rounding to the nearest ten are the same decision with a different step.

For most numbers it is not a choice at all. Look at the first digit being dropped. If it is 0 to 4, the number is less than half a step past the lower candidate, and it rounds down. If it is 6 to 9, it is more than half a step, and it rounds up. If it is 5 and any non-zero digit follows, as in 2.6751, it is still more than half, and it rounds up. All three round-to-nearest rules agree in every one of these cases.

They disagree only on an exact tie: a 5 with nothing after it, so the number sits precisely halfway. The school rule, round half up, sends ties up, so 2.675 to two places is 2.68 and 2.5 to a whole number is 3. Round half to even sends a tie to whichever neighbor has an even last digit: 2.5 becomes 2, 3.5 becomes 4, 2.675 becomes 2.68 because 8 is even and 7 is not. Round half away from zero matches half up on positive numbers and mirrors it on negative ones, so -2.5 becomes -3 rather than -2.

Half to even looks strange until you add things up. Round a long column of figures with the school rule and every tie goes the same direction, so the total of the rounded figures drifts above the total of the originals. Half to even sends half the ties each way and the drift cancels out. That is why it is the default rounding mode in IEEE 754 floating-point arithmetic, why it is called banker's rounding, and why Python's round() uses it.

The other three rules ignore how big the dropped part is. Truncation chops the extra digits off, which moves the number toward zero. Ceiling always goes up, toward positive infinity, so 2.001 becomes 3 and -2.9 becomes -2. Floor always goes down, so -2.1 becomes -3. Ceiling is what you want when a fraction of a unit still needs a whole one (boxes, buses, rolls of wallpaper), and floor is what you want when only complete units count.

Then there is the trap that makes most software disagree with the school rule. Computers store numbers in binary, and most decimal fractions have no exact binary form, just as 1/3 has no exact decimal form. 2.675 is stored as 2.67499999999999982236431605997495353221893310546875. Round that to two places and you get 2.67, correctly for the stored number and wrongly for the one you typed. Python's documentation uses this exact example to explain why round(2.675, 2) returns 2.67. This calculator never converts your number to binary: it reads the digits as text and does the rounding on them, so 2.675 is exactly 2.675 and the tie is a real tie.

Rounding to a fraction works the same way with a different step. To round to the nearest 1/8, multiply by 8, round to a whole number, and divide by 8 again. 2.3 times 8 is 18.4 eighths, which rounds to 18, which is 2 1/4. This is the rounding a tape measure, a drill index or a stock price quoted in sixteenths asks for.

Significant figures change what the step is. Instead of a fixed place, the step is set by the number's own first non-zero digit: three significant figures of 0.004056 means rounding to the hundred-thousandths, and of 40,560 it means rounding to the hundreds. The significant-figures calculator covers counting them and the arithmetic rules that use them.

Rounding Calculator FAQ

What is 2.675 rounded to two decimal places?

2.68 under the school rule (round half up), and also 2.68 under round half to even, because 8 is even. Many programs say 2.67, because they round the binary approximation 2.674999... rather than the number itself. Typed as text and rounded on its digits, as this calculator does, it is an exact tie that goes up.

What is banker's rounding?

Another name for round half to even. When a number is exactly halfway, it goes to the neighbor with an even last digit: 0.125 to two places is 0.12, 0.135 is 0.14. Rounding every tie upward biases a sum upward; sending half the ties each way removes that bias, which is why it is the IEEE 754 default.

How do you round a negative number?

The nearest-neighbor rules work the same way on the distance, so -2.4 becomes -2 and -2.6 becomes -3 under all of them. Only ties differ: round half up sends -2.5 toward positive infinity, to -2, while round half away from zero sends it to -3. Floor always goes more negative and ceiling always goes toward zero for negative numbers.

How do I round to the nearest eighth or sixteenth?

Multiply by 8 (or 16), round that to a whole number, and divide back. 5.3 to the nearest eighth: 5.3 x 8 = 42.4, which rounds to 42, and 42/8 is 5 1/4. The result is always a fraction with a power-of-two denominator in lowest terms, so its decimal form terminates.

Is rounding 4.45 to a whole number 4 or 5?

4. Only the first dropped digit decides, and it is 4, so the number is less than half a step past 4. Rounding twice (4.45 to 4.5, then 4.5 to 5) is the classic error: each rounding throws away information the next one needed. Always round once, from the original number.

Related calculators

Embed this calculator
<div id="compoundpage-rounding-calculator"></div>
<script src="https://compoundpage.com/embed/rounding-calculator.js" async></script>

The same calculation as JSON