changeset e04a7007d1fb in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=e04a7007d1fb
description:
        Always convert float value when applying factor

        Otherwise Numeric fields are stored as float when they have no digits

        issue9912
        review326771002
diffstat:

 src/model.js |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 6d6b1c06bfb5 -r e04a7007d1fb src/model.js
--- a/src/model.js      Fri Dec 04 18:41:38 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;
         },

Reply via email to