Skip to content

Commit 65d9b21

Browse files
committed
fix: handling float in greater_than, greater_than_equal_to, less_than, less_than_equal_to
1 parent a286430 commit 65d9b21

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

system/Validation/StrictRules/Rules.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function exact_length($str, string $val): bool
7575
*/
7676
public function greater_than($str, string $min): bool
7777
{
78-
if (is_int($str)) {
78+
if (is_int($str) || is_float($str)) {
7979
$str = (string) $str;
8080
}
8181

@@ -93,7 +93,7 @@ public function greater_than($str, string $min): bool
9393
*/
9494
public function greater_than_equal_to($str, string $min): bool
9595
{
96-
if (is_int($str)) {
96+
if (is_int($str) || is_float($str)) {
9797
$str = (string) $str;
9898
}
9999

@@ -213,7 +213,7 @@ public function is_unique($str, string $field, array $data): bool
213213
*/
214214
public function less_than($str, string $max): bool
215215
{
216-
if (is_int($str)) {
216+
if (is_int($str) || is_float($str)) {
217217
$str = (string) $str;
218218
}
219219

@@ -231,7 +231,7 @@ public function less_than($str, string $max): bool
231231
*/
232232
public function less_than_equal_to($str, string $max): bool
233233
{
234-
if (is_int($str)) {
234+
if (is_int($str) || is_float($str)) {
235235
$str = (string) $str;
236236
}
237237

0 commit comments

Comments
 (0)