I am using python 3.8.5 and rounding decimals and not floats which can behave strangely.
Python normally rounds all decimal.Decimals properly where .50 are rounded up.
However, only Decimal(1120.50) is rounding down. What could be the error in my code.
To recreate
import decimal
round(decimal.Decimal(1119.50))
# OK: Expected output 1120, actual output 1120
round(decimal.Decimal(1120.50))
# Wrong: Expected output 1121, actual output 1120
round(decimal.Decimal(1121.50))
# OK: Expected output 1122, actual output 1122
Any help would be appreciated.
Thanks