Rounding in simple words
Rounding makes a number shorter and easier to use, while keeping it close to the real value.
First pick the last digit you want to keep. Then look at the digit just after it. If that digit is 5 or more, add 1 to the kept digit. If it is 4 or less, leave the kept digit alone. Drop everything after it.
For example, to round 1234.5678 to 2 decimal places, keep 1234.56 and look at the next digit, 7. Seven is 5 or more, so round up to 1234.57.
Rounding to the nearest 10 works the same way: 47 becomes 50, because 7 is 5 or more. This calculator can also round to other multiples, such as the nearest 5 or 0.25.
Formula and method
When the discarded part is at least half of a unit in the retained place, increase the magnitude by one unit. Negative places round left of the decimal.
Worked example
1.005 rounds to 1.01 at two decimal places. At zero places, −2.5 rounds to −3. At −2 places, 1,250 rounds to 1,300.
Rounding methods compared
The half methods differ only on an exact tie, where the discarded part is exactly half a unit. Half away from zero sends 2.5 to 3 and −2.5 to −3. Half up sends ties toward positive infinity (−2.5 → −2), half down toward negative infinity (2.5 → 2), and half to even picks the even neighbour (2.5 → 2, 3.5 → 4).
The directed methods ignore how large the discarded part is. Ceiling always moves toward positive infinity, floor toward negative infinity, and truncation simply drops the discarded digits, which moves toward zero.
NIST SP 811 (§B.7.1) gives the half-to-even rule for an exact tie: 6.974 950 5 rounded to 7 digits is 6.974 950, and 6.974 951 5 is 6.974 952. Choosing half to even here reproduces those examples.
Rounding to a multiple
To round x to the nearest multiple of m, divide, round the quotient to a whole number, then multiply back: result = round(x ÷ m) × m. The division is exact, so decimal multiples such as 0.25 or 0.05 do not pick up floating-point error.
Example: 52 minutes to the nearest 15 is 52 ÷ 15 = 3.466…, which rounds to 3, and 3 × 15 = 45. With ceiling, it becomes 4 × 15 = 60. Rounding 1.13 to the nearest 0.25 gives 4.52 → 5 → 1.25.