Files
kiri-validator/RoundValidator.php
T

27 lines
381 B
PHP
Raw Permalink Normal View History

2022-01-09 14:01:11 +08:00
<?php
namespace validator;
/**
* Class RoundValidator
* @package validator
*/
class RoundValidator extends BaseValidator
{
2023-12-12 15:35:34 +08:00
/**
2023-12-18 15:01:09 +08:00
* @param string $field
* @param mixed $value
2023-12-12 15:35:34 +08:00
* @return bool
* @throws
*/
2023-12-19 14:51:13 +08:00
public function trigger(mixed $value): bool
2023-12-12 15:35:34 +08:00
{
2023-12-18 15:01:09 +08:00
return round($value, $this->value) == $value;
2023-12-12 15:35:34 +08:00
}
2022-01-09 14:01:11 +08:00
}