changeset 3b3226ff13b6 in sao:5.2
details: https://hg.tryton.org/sao?cmd=changeset;node=3b3226ff13b6
description:
Round step value
The result of Math.pow may have rounding issue (especially on Chrome)
so we
must round it otherwise the validation of the input may fail.
issue8707
review258301002
(grafted from deafb0b64c11939b6a5b5b27d2f844a9ba637580)
diffstat:
src/view/form.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 980aee98c8ac -r 3b3226ff13b6 src/view/form.js
--- a/src/view/form.js Thu Oct 24 19:14:23 2019 +0200
+++ b/src/view/form.js Thu Oct 24 19:17:29 2019 +0200
@@ -1602,7 +1602,7 @@
if (record) {
var digits = field.digits(record, this.factor);
if (digits) {
- step = Math.pow(10, -digits[1]);
+ step = Math.pow(10, -digits[1]).toFixed(digits[1]);
}
}
this.input.attr('step', step);
@@ -4290,7 +4290,7 @@
options = {};
var digits = this.digits;
if (digits) {
- step = Math.pow(10, -digits[1]);
+ step = Math.pow(10, -digits[1]).toFixed(digits[1]);
options.minimumFractionDigits = digits[1];
options.maximumFractionDigits = digits[1];
}