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
This commit is contained in:
Cédric Krier committed 2019-10-24 19:17:29 +02:00
1 parent 716c39005a
commit 431ff17988
1 file changed
+2 -2
+2 -2
View File
@@ -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];
}