diff --git a/src/Validator/IsFloat.php b/src/Validator/IsFloat.php index 0e662693..6c142563 100644 --- a/src/Validator/IsFloat.php +++ b/src/Validator/IsFloat.php @@ -118,6 +118,12 @@ public function isValid($value) return true; } + if ($value === '') { + $this->error(self::NOT_FLOAT); + + return false; + } + // Need to check if this is scientific formatted string. If not, switch to decimal. $formatter = new NumberFormatter($this->getLocale(), NumberFormatter::SCIENTIFIC);