MultiConvers

Rounding Calculator

Enter a number and how many decimal places you want. Use 0 for a whole number, or a negative place count to round to tens, hundreds or thousands.

How it works

Rounding to p decimal places scales the number by 10^p, applies half-away-from-zero, then scales back. 3.14159 to 2 places is 3.14. 2.5 to 0 places is 3, and −2.5 is −3 — both halves move away from zero, which matches school rounding better than JavaScript’s default toward +∞. A place count of −1 rounds to the nearest 10 (146 → 150); −2 to the nearest 100.

Place counts outside −12 to 12 are rejected.

Formula

rounded = sign(x) × round(|x| × 10^p) ÷ 10^p
3.14159 to 2 places = 3.14
146 to −1 place = 150

Worked examples

  • Two decimal places

    3.14159 to 2 places 3.14

  • Nearest ten

    146 to −1 place 150

Useful notes

  • This is not banker's rounding (half to even).
  • Trailing zeros are kept on the result so you can see the requested places.

FAQ

How do I round to two decimal places?

Look at the third decimal digit. If it is 5 or more, round the second digit up. 3.14159 becomes 3.14; 3.145 becomes 3.15.

How do I round to the nearest ten or hundred?

Use a negative place count: −1 for tens, −2 for hundreds, −3 for thousands.

What happens at exactly .5?

This page rounds half away from zero. 2.5 → 3 and −2.5 → −3.

Related tools

See all Math tools.