changeset ee830080cea5 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset;node=ee830080cea5
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 cd1ae38fda99 -r ee830080cea5 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
@@ -1786,8 +1786,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