Enter the number to round and the place to round to. You get the rounded, rounded-up and rounded-down results, plus other rounding methods, all at once.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formula
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter a number and the place to round to, and you get the rounded, rounded-up and rounded-down results all at once
- Round to any place you like: the nearest whole number, tenth, hundredth, ten, hundred and so on
- The results of rounding methods used in computing and statistics, such as round half to even (banker's rounding), the floor function and the ceiling function, are listed too
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
An item costs $3.98 and the sales tax rate is 7.25%. The tax is \(3.98 \times 0.0725 = 0.28855\) dollars, which has to become a whole number of cents. Most states have sellers round to the nearest cent, with half a cent or more rounded up, so the tax is $0.29.
Tax on a whole order and tax item by item can come out a cent apart because of rounding. Knowing this, you can check receipts and invoices with confidence.
US federal rules allow employers to round clock-in and clock-out times to the nearest 5, 6 or 15 minutes, as long as it evens out over time. With 15-minute rounding, 1 to 7 minutes past the quarter hour round down and 8 to 14 minutes round up. So clocking in at 8:07 counts as 8:00, and 8:08 counts as 8:15.
Your paycheck is built from roundings like this, so knowing how they work lets you check your own hours and pay.
If three choices each get about one third of the votes, rounding each to the nearest tenth of a percent gives \(33.3\% + 33.3\% + 33.3\% = 99.9\%\), not 100%.
This is not a counting mistake. It is simply what rounding does, and news charts often carry a note such as "Totals may not add up to 100% due to rounding". Knowing this helps you read statistics and charts correctly.
Each box of floor tile covers 10 square feet, and the room is 124 square feet. You need \(124 \div 10 = 12.4\) boxes, so you buy 13 (12 boxes would not be enough).
The number of tables for guests, buses for a field trip, boxes of medicine: whenever running short is a problem, rounding up is the right answer, not ordinary rounding. Choosing the right rounding method is part of the job.
Always rounding an exact half up pushes totals and averages slightly upward when there is a lot of data. For example, the ten numbers 0.5, 1.5, …, 9.5 have an average of exactly 5.0. If you round each one first and then average, you get 5.5. With round half to even, half the ties go up and half go down, the bias cancels out, and the average stays at 5.0.
That is why round half to even is the standard in finance, where interest is calculated again and again, and inside the decimal arithmetic of many programming languages (the IEEE 754 standard).
Formula
Symbols and terms
Symbols
| \(x\) | x | The number to round. (Example - a test average of 81.35) |
| \(n\) | n | The place to round to. 0 = the ones place, a positive number = \(n\) places after the decimal point, a negative number = the tens, hundreds, thousands… place. (Example - to round to the nearest hundred, \(n = -2\)) |
| \(q\) | q | The rounding unit. A rounded result is always a multiple of \(q\). \(q = 10^{-n}\), so it is \(0.01\) for the nearest hundredth and \(100\) for the nearest hundred. |
| \(R\) | R | The rounded result. Its value depends on the rounding method (rounding, rounding up, rounding down and so on). |
| \(\lfloor x \rfloor\) | floor of x | The greatest integer less than or equal to \(x\). For positive numbers it is the same as dropping the digits after the decimal point. (Example - \(\lfloor 5.99 \rfloor = 5\). But for negative numbers, \(\lfloor -5.01 \rfloor = -6\)) |
| \(\lceil x \rceil\) | ceiling of x | The least integer greater than or equal to \(x\). For positive numbers it is the same as rounding up. (Example - \(\lceil 5.01 \rceil = 6\). But for negative numbers, \(\lceil -5.01 \rceil = -5\)) |
Terms
| rounding | Replacing a number that has too many digits with a simpler number, following a fixed rule. Ordinary rounding, rounding up and rounding down are all kinds of rounding. |
| approximate number | A number that is close to the exact value, such as "about 1,900 people". Rounding is the most common way to make one, and US students first practice it in Grade 3. |
| round half away from zero | The school rounding method - if the next digit is 0 to 4, round down; if it is 5 to 9, round up. An exact half such as 2.5 always rounds up (for negative numbers, away from zero - −2.5 → −3). It is what Excel ROUND does. |
| round up | A rounding method that moves up to the next value if there is any leftover at all. 5.01 rounded up to a whole number is 6. It is used when running short would be a problem (such as how many boxes of material to buy). |
| round down | A rounding method that drops the leftover completely. 5.99 rounded down to a whole number is 5. It is also called truncating, and it is common with money and counts. |
| banker's rounding (round half to even) | A method that, only for an exact half, rounds to the side that gives an even result (2.5 → 2, 3.5 → 4). Unlike always rounding a half up, it does not push totals and averages in one direction, so it is standard in statistics, finance and inside computers. Python's round() works this way. |
| floor function | A math function written \(\lfloor x \rfloor\) that gives the nearest integer at or below \(x\) (toward −∞). For positive numbers it matches rounding down, but for negative numbers it goes the other way, which is how it differs from everyday rounding down. |
| ceiling function | A math function written \(\lceil x \rceil\) that gives the nearest integer at or above \(x\) (toward +∞). For positive numbers it matches rounding up, but for negative numbers it goes the other way, which is how it differs from everyday rounding up. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
| Place value (Grades 1–2) |
|
| How decimals work (Grades 4–5) |
|
| Rounding and approximate numbers (Grades 3–5) |
|
| Negative numbers and the number line (Grade 6) |
|
How to calculate it in Excel
| Number to round x | 2.7 |
| Rounded result | =ROUND(B1,0) |
| Number to round x | 5.01 |
| Rounded-up result | =ROUNDUP(B1,0) |
| Number to round x | 5.99 |
| Rounded-down result | =ROUNDDOWN(B1,0) |
| Number to round x | 1234.5678 |
| Place n (2 = hundredth, 0 = whole number, -2 = hundred) | -2 |
| Rounded result | =ROUND(B1,B2) |
The second argument of ROUND, ROUNDUP and ROUNDDOWN, "num_digits", means the same as "Round to (decimal places)" on this page (0 = whole number, 2 = hundredth, -2 = hundred).
Excel ROUND works like the rounding on this page: an exact half goes away from zero. ROUNDUP and ROUNDDOWN move away from zero and toward zero for negative numbers (ROUNDUP(-5.01,0) is -6).
For example, the first table shows 3 in B2, and the fourth table shows 1200 in B3.
How to calculate it in Google Sheets
| Number to round x | 2.7 |
| Rounded result | =ROUND(B1,0) |
| Number to round x | 5.01 |
| Rounded-up result | =ROUNDUP(B1,0) |
| Number to round x | 5.99 |
| Rounded-down result | =ROUNDDOWN(B1,0) |
| Number to round x | 1234.5678 |
| Place n (2 = hundredth, 0 = whole number, -2 = hundred) | -2 |
| Rounded result | =ROUND(B1,B2) |
How to calculate it in Python
from decimal import Decimal, ROUND_HALF_UP, ROUND_UP, ROUND_DOWN
number = Decimal("1234.5678") # number to round (always pass it as a string to avoid the 0.1 error problem)
digits = -2 # place to round to (2 = hundredth, 0 = whole number, -2 = hundred)
unit = Decimal(1).scaleb(-digits) # rounding unit (100 when digits is -2)
rounded = number.quantize(unit, rounding=ROUND_HALF_UP) # round (half away from zero)
rounded_up = number.quantize(unit, rounding=ROUND_UP) # round up (away from zero)
rounded_down = number.quantize(unit, rounding=ROUND_DOWN) # round down (toward zero)
print(f"Round: {rounded:f}")
print(f"Round up: {rounded_up:f}")
print(f"Round down: {rounded_down:f}")
How to write it in LaTeX and other math languages (copy and paste)
R = ⌊x + 0.5⌋
R = \lfloor x + 0.5 \rfloor
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi>
<mo>=</mo>
<mo>⌊</mo>
<mi>x</mi>
<mo>+</mo>
<mn>0.5</mn>
<mo>⌋</mo>
</mrow>
</math>
R = |__ x + 0.5 __|
Floor[x + 0.5]
R := floor(x + 0.5);
R = floor(x + 0.5);
R = ⌊x + 0.5⌋
R = ⌈x⌉
R = \lceil x \rceil
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi>
<mo>=</mo>
<mo>⌈</mo>
<mi>x</mi>
<mo>⌉</mo>
</mrow>
</math>
R = |~ x ~|
Ceiling[x]
R := ceil(x);
R = ceil(x);
R = ⌈x⌉
R = ⌊x⌋
R = \lfloor x \rfloor
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi>
<mo>=</mo>
<mo>⌊</mo>
<mi>x</mi>
<mo>⌋</mo>
</mrow>
</math>
R = |__ x __|
Floor[x]
R := floor(x);
R = floor(x);
R = ⌊x⌋
R = ⌊x ÷ q + 0.5⌋ × q
R = \left\lfloor \frac{x}{q} + 0.5 \right\rfloor \times q
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi>
<mo>=</mo>
<mo>⌊</mo>
<mfrac><mi>x</mi><mi>q</mi></mfrac>
<mo>+</mo>
<mn>0.5</mn>
<mo>⌋</mo>
<mo>×</mo>
<mi>q</mi>
</mrow>
</math>
R = |__ x/q + 0.5 __| xx q
Floor[x/q + 0.5] q
R := floor(x/q + 0.5) * q;
R = floor(x/q + 0.5) * q;
R = ⌊x/q + 0.5⌋ × q
How to have ChatGPT do the calculation
You are a calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Do not use Python's built-in round(), which rounds half to even. Use the decimal module (ROUND_HALF_UP and so on) instead. Round the number 1234.5678 to the nearest hundred in the following three ways: 1. Round (an exact half goes away from zero) 2. Round up (away from zero) 3. Round down (toward zero) Show the code you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
