I have a problem with float in Python...
I have this in a variable:
i = 9.600000000000001
And I would transform in this:
i = 9.60000
with five numbers after the decimal point and rounded.
Answer
>>> format(9.60000001,'.5f')
'9.60000'
>>>
No comments:
Post a Comment