From 431ff17988e071d2d8a12ce8bf568a555ac737bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 24 Oct 2019 19:17:29 +0200 Subject: [PATCH] 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 --- src/view/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/form.js b/src/view/form.js index 48f091c81e..072b62088e 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1673,7 +1673,7 @@ function eval_pyson(value){ 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 @@ function eval_pyson(value){ 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]; }