changeset deafb0b64c11 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=deafb0b64c11
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
diffstat:
src/view/form.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 55f0e73c3b8d -r deafb0b64c11 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
@@ -1673,7 +1673,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);
@@ -4461,7 +4461,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];
}