Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 9.12
>>> print (x * 100)
911.9999999999999
Conversation
Replying to
>>> import decimal
>>> decimal.Decimal("9.12")*100
Decimal('912.00')
>>> str(decimal.Decimal("9.12")*100)
'912.00'
>>> float(decimal.Decimal("9.12")*100)
912.0
>>>
1
1
Replying to
I get it his floating point related -- do you know why it works for 9.14 - 9.19 and gives the correct value but not for 9.12 and 9.13?
2
Show replies

