src/forms/QuantityField.php
public function validate($validator)
    {
        $value = $this->Value() + 0;
        
        if(is_int($value)) {
            return true;
        }
        
        $validator->validationError(
            $this->name,
            _t(
                'Checkout.VALIDATION', '{value} is not a valid number, only whole numbers can be accepted for this field',
                array('value' => $value)
            ),
            "validation"
        );

        return false;
    }
public function validate($validator)
    {
        $value = $this->Value() + 0;
        
        if(is_int($value)) {
            return true;
        }
        
        $validator->validationError(
            $this->name,
            _t(
                'Checkout.VALIDATION', '{value} is not a valid number, only whole numbers can be accepted for this field',
                array('value' => $value)
            ),
            "validation"
        );

        return false;
    }
PHP Validation

@return boolean
@throws Exception