Rounding to decimal places

We can round numbers to the nearest n decimal places using these steps:

  1. Find the digit at the nth decimal place.
  2. Check if the number after that is less than 5:
    • If less than 5, you are rounding down, so keep the nth decimal place the same.
    • If more than or equal to 5, you are rounding up, so increase the nth decimal place by one (if it is 9, it becomes 0 and you carry 1 to the left, where you do the same).
  3. Remove all digits after the nth decimal place.

Examples

Round 3.14159 to 2 decimal places

Round 2.71828 to 3 decimal places

Round 1.98765 to 4 decimal places

Round 0.798 to 2 decimal places