[I think this would be better in python-list, not python-dev] > the number actually comes from multiplication between > 237.50 and 4.762 which will get 1130.975. So it suppose > to be 1130.98 isnt it if it'll get rounded to 2 decimal > places. Gary is correct: >>> 237.50 * 4.762 1130.9749999999999 >>> round(_,2) 1130.97 >>> print 237.50 * 4.762 1130.975 The answer correctly rounds to 1130.97 because the next digit is 4, not 5. When you print it, it rounds to 3 decimal places, so you get the .9749 rounding to .975. This is just floating point arithmetic. You might want to try the Decimal module, or something like that, to avoid this. =Tony Meyer
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4