Commit 6dcd2497 authored by Yusei Tahara's avatar Yusei Tahara

Fix a bug. If precision was 1, rounding did not work correctly.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39268 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 986c7e26
......@@ -76,7 +76,7 @@ class RoundingModel(Predicate):
precision = 1
scale = int(log(precision, 10))
if scale > 0:
if scale > 0 or (scale==0 and precision>=1):
value = Decimal(str(value))
scale = Decimal(str(int(precision))).quantize(value)
precision = Decimal('1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment