Float -> Decimal in Python implementation