changeset a1bb8e440d71 in sao:5.8
details: https://hg.tryton.org/sao?cmd=changeset;node=a1bb8e440d71
description:
Always convert float value when applying factor
Otherwise Numeric fields are stored as float when they have no digits
issue9912
review326771002
(grafted from e04a7007d1fb8c6b9922d93c8965da5426ed46b1)
diffstat:
src/model.js | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (14 lines):
diff -r 536ebb099ede -r a1bb8e440d71 src/model.js
--- a/src/model.js Fri Dec 04 18:37:36 2020 +0100
+++ b/src/model.js Sun Dec 06 18:26:31 2020 +0100
@@ -1907,8 +1907,9 @@
if (digits) {
// Round to avoid float precision error
// after the division by factor
- value = this.convert(value.toFixed(digits[1]));
+ value = value.toFixed(digits[1]);
}
+ value = this.convert(value);
}
return value;
},