changeset d33dfa4d9405 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset;node=d33dfa4d9405
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 184aec90cacf -r d33dfa4d9405 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
@@ -1856,8 +1856,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;
         },

Reply via email to