Rounding calculator: decimal places, nearest ten, or significant figures — every method in one place
The Davided rounding calculator rounds any number the way you actually need it rounded. Type a number, choose what you’re rounding to — a fixed number of decimal places, the nearest ten/hundred/thousand, or a set number of significant figures — and pick how it should round: the everyday “half up” rule, banker’s rounding, ceiling, floor, or truncation. Most rounding tools online only offer one or two of these; this one covers all five modes and all three targets in a single calculator.
That matters most on negative numbers and exact ties (numbers ending in exactly .5), where the five modes genuinely disagree. −2.5 rounded to a whole number is −3 under the everyday rule, but −2 under banker’s rounding, and −2 again under ceiling — three different, all “correct,” answers depending on which rule you mean. This calculator spells out which mode you’re using and, when it matters, shows you what the other modes would have given instead.
How to use the rounding calculator
- Enter the number. Positive, negative, whole, or decimal — any value works.
- Choose what to round to. Pick decimal places (0 for a whole number), nearest ten/hundred/thousand/ten thousand/million, or a number of significant figures.
- Pick the rounding mode. Half up (the default, “away from zero”), banker’s rounding (half to even), ceiling, floor, or truncate.
- Read the result. If the other four modes would give a different answer for your specific number, the calculator shows you what each one produces, so you can see exactly where the modes diverge.
How rounding works
The general rule: round to any target
Every rounding target — decimal places, tens, hundreds, thousands, significant figures — works the same way underneath: divide the number by the target step, round that to the nearest whole number using your chosen mode, then multiply back. To round 12,345 to the nearest thousand, divide by 1,000 to get 12.345, round that to 12, then multiply back to get 12,000.
The five rounding modes, including negative numbers
- Half up (round half away from zero). The rule taught in school: round down if the next digit is below 5, round up if it’s 5 or above. Ties always move away from zero, so 2.5 → 3 and −2.5 → −3. This is the calculator’s default.
- Banker’s rounding (round half to even). Identical to half up except at exact ties, which round to the nearest even whole number instead: 2.5 → 2, 3.5 → 4, and −2.5 → −2. It’s the default rounding rule in IEEE 754 (the standard behind most computer arithmetic) and in Python’s
round(). - Ceiling. Always rounds toward positive infinity, regardless of sign. For positive numbers it behaves like rounding up; for negative numbers it moves toward zero: ceiling(−2.7) = −2.
- Floor. Always rounds toward negative infinity, regardless of sign. For negative numbers it moves away from zero: floor(−2.1) = −3.
- Truncate. Simply drops everything past the target position, without looking at its value. It always moves toward zero, so truncate(−7.89, 1 decimal) = −7.8 — the same direction as ceiling for negative numbers, not floor, which trips people up.
Significant figures
Significant figures count meaningful digits starting from the first non-zero digit, no matter where the decimal point sits. Leading zeros (like the “0” in 0.045) never count; zeros between other digits always count; trailing zeros after a decimal point count, but trailing zeros in a whole number (like the zeros in 1300) are ambiguous about whether they’re meaningful. Rounding can also push a number into a different order of magnitude — 9.96 rounded to 2 significant figures becomes 10, gaining a digit in the process.
The floating-point rounding trap
Some decimals that look simple, like 2.675, aren’t stored exactly in a computer’s binary floating-point format — 2.675 is actually held as a value fractionally below 2.675. That’s why a naive calculation in a spreadsheet or a script can round 2.675 to 2 decimal places as 2.67 instead of the mathematically correct 2.68: it’s rounding the stored approximation, not the number you typed. This calculator works from the number’s decimal representation directly, so it rounds 2.675 to 2.68, matching what you’d get rounding it by hand.
Step-by-step examples
Example 1: a normal decimal round — 3.14159 to 2 decimal places
The third decimal digit is 1, below 5, so half-up rounds down: 3.14159 → 3.14. Ceiling, which always rounds toward +∞ for a positive number, instead gives 3.15 — the only mode that disagrees here.
Example 2: an exact tie — 2.5 rounded to a whole number
Half up moves away from zero: 2.5 → 3. Banker’s rounding instead goes to the nearest even whole number, and 2 is even: 2.5 → 2.
Example 3: a negative tie, all five modes — −2.5 rounded to a whole number
Half up: −3 (away from zero). Banker’s rounding: −2 (2 is even). Ceiling: −2 (toward +∞). Floor: −3 (toward −∞). Truncate: −2 (toward zero). Four of the five modes land on different pairs of values — this is the case where mode choice matters most.
Example 4: rounding to the nearest thousand, with a tie — 12,345 and 12,500
12,345 rounded to the nearest thousand (half up) is 12,000 (12.345 rounds down to 12). 12,500 sits exactly on the boundary: half up rounds it to 13,000, while banker’s rounding rounds it to 12,000, since 12 is even.
Example 5: significant figures that change the order of magnitude — 9.96 to 2 significant figures
The third significant digit (6) rounds the second digit up, carrying through the whole number: 9.96 → 10. The result now has one more digit before the decimal point than the original number.
Example 6: negative decimals, truncate vs. floor — −7.89 to 1 decimal place
Truncate simply drops the second decimal digit and moves toward zero: −7.89 → −7.8. Floor always moves toward −∞, so it rounds further away from zero instead: −7.89 → −7.9.
Example 7: the floating-point trap in practice — 2.675 to 2 decimal places, half up
Mathematically, the digit being dropped is 5, so half-up rounds away from zero: 2.675 → 2.68. A calculator or script that multiplies the raw floating-point value by 100 and rounds it will often get 2.67 instead, because 2.675 isn’t stored exactly in binary — this calculator avoids that trap by rounding the decimal value directly.