Skip to content
Snippets Groups Projects
Commit 81233285 authored by Raphael Collet's avatar Raphael Collet
Browse files

[IMP] fields: speedup `Float.convert_to_cache` by not rounding the value

parent f0646cb5
Branches
Tags
No related merge requests found
......@@ -1096,6 +1096,8 @@ class Float(Field):
def convert_to_cache(self, value, record, validate=True):
# apply rounding here, otherwise value in cache may be wrong!
value = float(value or 0.0)
if not validate:
return value
digits = self.digits
return float_round(value, precision_digits=digits[1]) if digits else value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment