I got confusing with the result of round() with 2 decimal places
a = 1352.845
res = round(a, 2)
=> 1352.85 (Right as I expected)
b = 578.005
res = round(b, 2)
=> 578.0 (Wrong, It would be 578.01 instead of 578.0)
what happens with case b or Have I misunderstood anything?
Answer:
from decimal import Decimal, ROUND_UP
Decimal('578.005').quantize(Decimal('.01'), rounding=ROUND_UP)
Because it needs to be used for monetary so the default convention of python round() (Banker's Rounding) doesn't right in my case