Nov-11-2023, 10:29 PM
(Nov-11-2023, 07:51 PM)buran Wrote: have a look at decimal module from standard library. you are working with money, so always 2 decimal places
I just tried it out and it seems to be doing the exact thing I was afraid float would do.
previousOwing = decimal.Decimal(234.55) print(previousOwing)
Output:234.55000000000001136868377216160297393798828125
which is ironic, because float seems to work perfectly:previousOwing = float(234.55) print(previousOwing)
Output:234.55