1 2 3 4 5 6 7 8
>>> from_dtn = 1.2 >>> from_sql = decimal.Decimal('1.2') >>> from_dtn == from_sql False >>> round(from_dtn, 1) == from_sql False >>> decimal.Decimal(from_dtn).quantize(decimal.Decimal('1.0')) == from_sql True
You can clone a snippet to your computer for local editing. Learn more.