[IMP] fields: speedup `Float.convert_to_cache` by not rounding the value
This commit is contained in:
parent
f0646cb51b
commit
812332855a
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue