fournee/fournée/core/utils.py

9 lines
177 B
Python
Raw Normal View History

2024-05-15 15:50:11 +02:00
from decimal import Decimal
def clean(d):
if d == d.to_integral():
return d.quantize(Decimal(1))
else:
return d.quantize(Decimal('1.000')).normalize()