Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: controllers/calculator.php

Line Number: 37

- 1-800-665-6601
- info@tutorpace.com

Rules for rounding a decimal number:

- Decide number of digits up to which we have to round off decimal number. Look at the number to the right of this digit.
- It this is less than 5 then keep the previous number unchanged.
- If this number is greater than or equal 5 then add 1 to the previous number.

Solution: we have to round off this number up to 3 decimal places. Hence look at the number to the right of third digit after

decimal point. It is 9. Since 9 is greater than 5 we have to increase third digit by 1.

Third digit after decimal point is 0. Increasing by 1 it becomes 1.hence we replace third digit 0 by 1 and trim the digits after this

0.

Hence number becomes: 4005.901

Solution: we have to round off this number up to 2 decimal places. Hence look at the number to the right of second digit after

decimal point. It is 1. Since 1 is less than 5 we keep second digit after decimal point unchanged.

Second digit after decimal point is 8 remains same and trim the all the digits after this 8.

Hence number becomes: 23.78