Commit 202372cb authored by Kevin Deldycke's avatar Kevin Deldycke

getPrecisionAsInteger() duplicate with the similar method on Resource.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5832 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e22a8900
...@@ -71,15 +71,3 @@ class Currency(Resource): ...@@ -71,15 +71,3 @@ class Currency(Resource):
if to_currency is self: if to_currency is self:
return quantity return quantity
return quantity return quantity
# Unit precision
security.declareProtected(Permissions.AccessContentsInformation, 'getPrecisionAsInteger')
def getPrecisionAsInteger(self):
float_precision = str(self.getBaseUnitQuantity())
decimal_split = float_precision.split('.')
integer_part = decimal_split[0]
floating_part = decimal_split[1]
if floating_part[-1] == '0':
return 0
else:
return len(floating_part)
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