Snippets

Kim Minh Kaplan 7ez5gK: Untitled snippet

Created by Kim Minh Kaplan
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

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.