0

I'm trying to solve a simple challenge that requires the code to return numbers (floats) rounded to 1 decimal point(s). The code is actually working but it seems that round() is not returning the correct result.

For example, the answer to one of the test cases I'm getting is 45357.45. When rounded to the first decimal, this should be 45357.5. But using round() is still returning 45357.4. I tested with the following numbers and I'm getting mixed results:

# Correct
print(round(5.45, 1))
5.5

# Incorrect
print(round(5674.45, 1))
5674.4

Why would this happen and is there a way to fix it?

accdias
  • 5,160
  • 3
  • 19
  • 31
shiv_90
  • 1,025
  • 3
  • 12
  • 35

0 Answers0