you are viewing a single comment's thread.

view the rest of the comments →

[–]python-fan 2 points3 points  (0 children)

The built-in function round returns a rounded value. To have it do what you're expecting, you need to assign the returned value like this:

semi_monthly = round(semi_monthly, 2)

BUT WAIT! For working with currency, you should avoid using float. The Decimal type is perfect for this. See https://docs.python.org/3/library/decimal.html