validaiton math rounding - fixes #3761

This commit is contained in:
Andy Miller 2023-10-25 12:38:12 +01:00
parent 45f8fe4d0b
commit 6d5f0ff9ba
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
# v1.7.44
## 10/02/2023
1. [](#bugfix)
* Fixed a math rounding issue with number validation when using floating point steps [#3761](https://github.com/getgrav/grav/issues/3761)
# v1.7.43
## 10/02/2023

View File

@ -550,7 +550,7 @@ class Validation
$step = (float)$params['step'];
// Count of how many steps we are above/below the minimum value.
$pos = ($value - $min) / $step;
$pos = round($pos, 10);
return is_int(static::filterNumber($pos, $params, $field));
}