Round any number the standard school way — round half up — to a chosen number of decimal places, to the nearest ten, hundred or thousand, or to a set number of significant figures.
When the dropped part is exactly half (a 5 followed by nothing), the number rounds up, away from zero for positives. It is the convention taught in schools and used in most everyday contexts. Bankers' rounding (half to even) exists in finance and computing but is not the default here.
Digits that carry meaning, counted from the first non-zero digit. 0.004560 has 4 significant figures (4, 5, 6 and the trailing 0). Rounding to significant figures keeps precision proportional to the size of the number, which is why scientists prefer it.
That is rounding at place value −3: look at the hundreds digit; 1,234 has hundreds digit 2, so it rounds down to 1,000, while 1,567 rounds up to 2,000.
Binary floating point cannot store most decimal fractions exactly, so naive code sometimes rounds 'wrong'. This calculator corrects with a tiny epsilon so exact halves behave the way school maths expects.
Decimal places: rounded = round(x × 10ᵈ) ÷ 10ᵈ using round-half-up (with an epsilon correction for binary floating point). Place value: the same formula with negative d — rounding to the nearest 100 is d = −2. Significant figures: if x ≠ 0, d = sig − 1 − floor(log₁₀|x|), then apply the decimal-places rule with that d.
Inputs: x = 1,234.5678.
Steps: 2 decimal places: 1,234.5678 × 100 = 123,456.78 → round → 123,457 → ÷ 100 = 1,234.57. Nearest 100: 1,234.5678 ÷ 100 = 12.345678 → round → 12 → × 100 = 1,200. 4 significant figures: the first four significant digits are 1, 2, 3, 4 (the number to the ones place, 1,234); the next digit is 5 (the tenths digit), so the ones digit rounds up from 4 to 5, giving 1,235. In formula terms, floor(log₁₀ 1234.5678) = 3, so d = 4 − 1 − 3 = 0 decimal places.
Result: 1,234.57 (2 d.p.), 1,200 (nearest 100), 1,235 (4 s.f.).
Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.