How the Decimal Calculator Works
Decimals are numbers with a point, such as 12.345 or 0.5. Adding, subtracting, multiplying and dividing them by hand is slow, and mistakes are easy. The Decimal Calculator does the arithmetic for you and rounds the answer to the number of decimal places you choose, from 0 to 10. It also shows the exact, unrounded value.
What you enter
- First number and Second number: any decimal numbers (the defaults are 12.345 and 6.78).
- Operation: add, subtract, multiply or divide.
- Decimal places: how many digits to keep after the point, from 0 to 10 (the default is 2).
What you get
- The rounded result, to the decimal places you chose.
- The unrounded value, so you can see the full answer.
- The sum, difference, product or quotient written as a short calculation, such as 12.345 + 6.78.
A worked example
The default is 12.345 + 6.78, rounded to 2 decimal places:
| Step | Value |
|---|---|
| 12.345 + 6.78 | 19.125 |
| Rounded to 2 places | 19.13 |
The digit after the second place is a 5, so the calculator rounds up. This is "round half up" (away from zero), the rule taught in school.
All four operations on the same numbers
| Operation | Unrounded | 2 places |
|---|---|---|
| 12.345 + 6.78 | 19.125 | 19.13 |
| 12.345 - 6.78 | 5.565 | 5.57 |
| 12.345 x 6.78 | 83.6991 | 83.70 |
| 12.345 / 6.78 | 1.8207964601... | 1.82 |
Chart: the four answers
The longer the bar, the bigger the result:
add █████████ 19.125 subtract ███ 5.565 multiply ████████████████████████████████████████ 83.6991 divide █ 1.8208
How rounding works
| Number | Places | Result |
|---|---|---|
| 3.14159 | 2 | 3.14 |
| 3.14159 | 4 | 3.1416 |
| 2.5 | 0 | 3 |
| 1.005 | 2 | 1.01 |
| 10 / 3 | 6 | 3.333333 |
Many calculators and programs show 1.005 rounded to 2 places as 1.00, because of how computers store decimals. This calculator rounds the way you would on paper, so it gives 1.01.
Chart: rounding error
Take 2/3 = 0.666666... Each extra decimal place makes the rounding error about 10 times smaller:
1 place (0.7) ████████████████████████████████████████ error 0.0333 2 places (0.67) ████ error 0.00333 3 places (0.667) ▏ error 0.000333 4 places (0.6667) ▏ error 0.0000333
Floating-point noise removed
Computers store decimals in binary, so 0.1 + 0.2 comes out as 0.30000000000000004 in many programs. This calculator cleans that up and shows 0.3.
Tips
- Dividing by zero is not allowed, and the calculator tells you so.
- Use more places for money calculations in the middle, and round only at the end. Rounding at every step builds up small errors.
- Check the size of the answer. 12.345 x 6.78 should be a little over 12 x 7 = 84... and it is 83.70.
- The decimal places must be a whole number from 0 to 10.
This tool gives an estimate for general information only. For accounting, tax or legal figures, follow the rounding rules that apply to you.