src/Validate.php
public static function double($input, $min = null, $max = null, $field_name = 'double')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_DOUBLE, Validate::REQUIRED]
        ];

        if ($min !== null) {
            $model[$field_name]['min'] = $min;
        }

        if ($max !== null) {
            $model[$field_name]['max'] = $max;
        }

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function double($input, $min = null, $max = null, $field_name = 'double')
    {
        //Define trivial model
        $model = [
            $field_name => ['type' => Validate::TYPE_DOUBLE, Validate::REQUIRED]
        ];

        if ($min !== null) {
            $model[$field_name]['min'] = $min;
        }

        if ($max !== null) {
            $model[$field_name]['max'] = $max;
        }

        $parameters = [$field_name => $input];
        Validate::model($parameters, $model);

        return $parameters[$field_name];
    }
public static function double ( $ input , $ min = null , $ max = null , $ field_name = 'double' ) { //Define trivial model $ model = [ $ field_name => [ 'type' => Validate :: TYPE_DOUBLE , Validate :: REQUIRED ] ] ; if ( $ min !== null ) { $ model [ $ field_name ] [ 'min' ] = $ min ; } if ( $ max !== null ) { $ model [ $ field_name ] [ 'max' ] = $ max ; } $ parameters = [ $ field_name => $ input ] ; Validate :: model ( $ parameters , $ model ) ; return $ parameters [ $ field_name ] ; }
Validate a double presision floating point number
@param string|double|float|int $input
@param double|null $min Minimum value. Optional default is NULL, if NULL then the minum value is skipped
@param double|null Maximum value. Optional default is NULL, if NULL then the maximum value is skipped
@param string $field_name [optional] Field's name, used in IncorrectParametersException.
Optional default is number
@return double Returns the input value as double
@throws IncorrectParameters If value type is not correct.
Validate a double presision floating point number