Troy Peterson

Greenhorn

Posts: 6

posted 2 years ago

Your calculation:

1. Take two integers and divide one by the other. The result is an integer: for example 11 / 3 yields 3.

2. Multiply by 10. (Yields 30 in this example)

3. Round to the nearest integer. (Yields 30 again)

4. Divide by 10. (Yields 3 again)

I'm assuming that when you say you want to round to the nearest "tens" place you don't actually want to round 257.325 to 260. I'm assuming you actually want to round it to the nearest tenth, which would be 257.3? If that's the case then it's only step 1 in your calculation which is throwing it off.

1. Take two integers and divide one by the other. The result is an integer: for example 11 / 3 yields 3.

2. Multiply by 10. (Yields 30 in this example)

3. Round to the nearest integer. (Yields 30 again)

4. Divide by 10. (Yields 3 again)

I'm assuming that when you say you want to round to the nearest "tens" place you don't actually want to round 257.325 to 260. I'm assuming you actually want to round it to the nearest tenth, which would be 257.3? If that's the case then it's only step 1 in your calculation which is throwing it off.

Troy Peterson

Greenhorn

Posts: 6