How rounding is calculated
Enter a number and how many decimal places to keep. The result keeps that many digits after the decimal point. 0 places rounds to a whole number.
If the first dropped digit is 5 or more, the last kept digit moves away from zero. The row below is the rounded value minus the original number.
How to use this calculator
- Enter the number.
- Enter the decimal places, from 0 to 6.
- Read the rounded number. The row below is the difference.
Round half away from zero
x is the number. k is the decimal places. y is the rounded absolute value. The sign of x is put back on y.
A negative number uses the same steps on its absolute value, then the minus sign returns. −2.5 to 0 places is −3.
Source
Rounding half away from zero is described on the Wikipedia page on rounding.
Worked examples
Example: 2.5 to 0 places
2.5 rounds to 3. The difference is 0.5.
Example: 3.14159 to 2 places
3.14159 rounds to 3.14. The difference is −0.00159.
What to keep in mind
The number can be from −1,000,000,000 to 1,000,000,000. Decimal places are a whole number from 0 to 6. −2.5 to 0 places is −3, and the difference is −0.5. 1.25 to 1 place is 1.3. 7 decimal places have no result. A completed result, including the number and the decimal places, can be stored in this browser’s local history and never leaves your device. Clear it with the history Clear action or by clearing site data.
Common questions about rounding
What is 2.5 rounded to 0 decimal places?
3. The difference is 0.5.
What is 3.14159 rounded to 2 decimal places?
3.14. The difference is −0.00159.
What is −2.5 rounded to 0 decimal places?
−3. The difference is −0.5, because 5 rounds away from zero.
What is 1.25 rounded to 1 decimal place?
1.3.
What can I enter?
A number from −1,000,000,000 to 1,000,000,000, and a whole number of decimal places from 0 to 6. 7 places have no result.
Does this calculator store my number?
A completed result can be saved in this browser’s local history, including the number and the decimal places. It stays on your device and is not sent to our servers or to analytics. Clear it with the history Clear action or by clearing site data.