Skip to content

Commit

Permalink
validaiton math rounding - fixes #3761
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 25, 2023
1 parent 45f8fe4 commit 6d5f0ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Data/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public static function typeNumber($value, array $params, array $field)
$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));
}

Expand Down

0 comments on commit 6d5f0ff

Please sign in to comment.