Rounding Calculator
Pick a place and a rule. The number is rounded on its digits, not as a float, so 2.675 to the hundredths is 2.68 under half up.
https://flxcode.com/rounding-calculator/
Example
2.675 rounded to the hundredths place, half up, is 2.68.
Steps
- Keep 2.67 (up to the hundredths place).
- The part dropped is 5, exactly half.
- Half or more rounds up, away from zero.
- Result: 2.68.
The same number under each rule, to the hundredths
| Rule | Result |
|---|---|
| Half up | 2.68 |
| Half even | 2.68 |
| Down | 2.67 |
| Up | 2.68 |
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
The four rules
| Rule | What it does |
|---|---|
| Half up | Ties go away from zero: 2.5 becomes 3 and -2.5 becomes -3. The rule taught in school. |
| Half even (banker’s) | Ties go to the even neighbour: 2.5 becomes 2 and 3.5 becomes 4. Used in accounting and by IEEE 754. |
| Down (toward zero) | Drops the extra digits: 2.99 becomes 2 and -2.99 becomes -2. |
| Up (away from zero) | Anything left over bumps the digit: 2.01 becomes 3 and -2.01 becomes -3. |
Only the rule changes the answer when the dropped part is exactly half. Away from a tie, half up and half even agree.
Worked examples
| Number | To the | Half up | Half even | Down | Up | Note |
|---|---|---|---|---|---|---|
| 2.675 | hundredths | 2.68 | 2.68 | 2.67 | 2.68 | The famous one. A float says 2.67, exact decimals say 2.68 |
| 2.665 | hundredths | 2.67 | 2.66 | 2.66 | 2.67 | Half even sends the tie down to the even 6 |
| 2.5 | ones | 3 | 2 | 2 | 3 | The tie that half up and half even split on |
| 3.5 | ones | 4 | 4 | 3 | 4 | Half even goes up here, to the even 4 |
| -2.5 | ones | -3 | -2 | -2 | -3 | Half up goes away from zero |
| 1234.5678 | hundreds | 1200 | 1200 | 1200 | 1300 | A place left of the point |
| 0.0456 | thousandths | 0.046 | 0.046 | 0.045 | 0.046 | Rounding a small decimal |
Place names
Left of the decimal point the places are ones, tens, hundreds, thousands. Right of it they are tenths, hundredths, thousandths. In 4,382.917 the 8 is in the hundreds place and the 1 is in the hundredths place. To round to a place, keep that digit, look one digit to its right, and apply the rule.
If you want to keep a number of meaningful digits instead of a place, use the sig fig calculator.
Why floats round wrong
A float stores a binary fraction. 0.1 and 2.675 have no exact binary form, so the stored value is a hair above or below. Rounding that stored value gives results like 2.67 for 2.675 or 1.0 for 0.9999999999999999. The fix is to round the decimal text. That is what this page does, with BigInt arithmetic on the digits.
Numbers this uses
- Half up: a dropped part of exactly 5, 50, 500 and so on goes away from zero. This is the school rule.
- Half even: the same tie goes to the neighbour with an even last digit, as in IEEE 754 and Python's round().
- Down is toward zero and Up is away from zero, so they treat negatives as the mirror of positives.
- Size: up to 200 digits. Commas, spaces and e-notation (1.5e3) are accepted. A result keeps its trailing zeros, so 2.6 to the hundredths shows 2.60.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
How do I round a number?
Find the digit you are rounding to. Look at the digit right after it. If that digit is 5 or more, add 1 to the kept digit (round up). If it is 4 or less, leave the kept digit alone. Then drop everything after it. 3.14159 to the hundredths is 3.14 because the next digit is 1.
Why does 2.675 round to 2.67 in some programs?
Computers store most decimals as binary floats, and 2.675 is really stored as 2.67499999999999982236431605997495353221893310546875. A float-based rounding sees something just under half and rounds down. This calculator works on the digits you typed, so 2.675 is exactly 2.675 and half up gives 2.68.
What is half even rounding?
Also called banker's rounding. A tie (exactly 5 after the kept digit) goes to the neighbour whose last digit is even. 2.5 becomes 2, 3.5 becomes 4, 2.665 becomes 2.66. Over many numbers the errors cancel instead of all pushing the total up.
How do I round to the nearest ten, hundred or thousand?
Pick the place from the list. 1,234.5678 to the hundreds is 1,200, because the tens digit is 3. To the thousands it is 1,000. Rounding to a place left of the point turns the digits after it into zeros.
What is the difference between rounding down and rounding toward zero?
On positive numbers there is none. For negatives they differ: toward zero takes -2.7 to -2, while "down" in the sense of the floor takes it to -3. This tool's Down rule is toward zero, and Up is away from zero. Use half up if you want ordinary school rounding.
How do I round negative numbers?
Half up here means ties go away from zero, so -2.5 becomes -3, the mirror image of 2.5 becoming 3. Some software rounds -2.5 to -2 (half toward positive infinity). If your numbers must match that program, check which tie rule it uses.
Should I use half up or half even?
Half up for schoolwork, shop prices and most reports. Half even for accounting, statistics and anything summed over many rows, because it has no upward bias. Python's round() and the IEEE 754 standard use half even.
Is the number I type saved or sent?
No. The rounding runs in your browser. What you type is not put in the address bar, not stored and not counted. We only count which rule was used.
More from FLXCode
Sig Fig CalculatorNew
Count significant figures with every digit marked, round to n, and add, subtract, multiply or divide by the rules.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.
Exponent CalculatorNew
Powers with integer, negative and fractional exponents. Integer results are exact, with scientific notation.
Roman Numeral ConverterNew
Turn numbers into Roman numerals and back, 1 to 3999. Says why an invalid numeral is wrong.