filter positive float
@param $value
@param array $options
@return float
5504
public static function ufloat(&$value, $options = ['max'=>null, 'min'=>null, 'default'=>null])
    {
        $value = (float)$value;
        self::processUNum($value, $options);
        return $value;
    }
678479
public function filter($value, $options = [])
    {
        if ($this->getPattern() == null) {
            $ex = new \Exception(get_class($this) . ' does not have a valid MatchPattern set.');
            throw $ex;
        }

        return preg_replace($this->getPattern(), $this->getReplacement(), $value);
    }
562443
private function getValue($value)
    {
        if ($this->isBoolean($value)) {
            return (strtolower($value) === 'true');
        } elseif ($this->isInteger($value)) {
            return (int)$value;
        } elseif ($this->isNumber($value)) {
            return (float)$value;
        }
        return $value;
    }
830239
public function filter($value) {

        if(in_array($value, $this->options["true"], true))
            return true;

        if(!$this->options["strict"])
            return (boolean)$value;

        return false;
    }
808974
protected function decrypt($value, $options)
    {
        $secure = $this->secure($options);

        return $secure->decrypt($value);
    }
1309524
protected function _adjustValue($value, $options)
    {
        $options += ['interval' => 1, 'round' => null];
        $changeValue = $value * (1 / $options['interval']);
        switch ($options['round']) {
            case 'up':
                $changeValue = ceil($changeValue);
                break;
            case 'down':
                $changeValue = floor($changeValue);
                break;
            default:
                $changeValue = round($changeValue);
        }

        return ($changeValue * $options['interval']) - $value;
    }
1202870
public static function toFloat($value)
    {
        if (!static::is($value)) {
            throw new \InvalidArgumentException(
                "The \$value parameter must be numeric (or string representing a big number)."
            );
        }

        if (is_int($value) || is_float($value)) {
            return (float)$value;
        } else {
            return ((Str::contains($value, '.')) ? $value : $value . '.0');
        }
    }
94979
public function filter($value)
    {
        if (!is_numeric($value)) {
            return $value;
        }

        // Parse to float and check if value is not zero
        $amount = (float) $value;
        if ($amount == 0) {
            return $this->formatAmount($amount);
        }

        // Calculate the correct size and prefix:
        $base = $this->isBinaryMode() ? self::BASE_BINARY : self::BASE_DECIMAL;
        $power = floor(log($amount, $base));
        $prefix = $this->getPrefixAt((int)$power);

        // When the amount is too big, no prefix can be found:
        if (is_null($prefix)) {
            return $this->formatAmount($amount);
        }

        // return formatted value:
        $result = ($amount / pow($base, $power));
        $formatted = number_format($result, $this->getPrecision());
        return $this->formatAmount($formatted, $prefix);
    }
782276
final public static function hasLength ($value, array $options=[]) : bool
	{
		$valueLength = strlen($value);
		if (!self::hasValue($value)) new ErrorCode(1001);

		if (isset($options['max']) && ($valueLength > (int) $options['max']))
			return FALSE;

		if (isset($options['min']) && ($valueLength < (int) $options['min']))
			return FALSE;

		if (isset($options['exact']) && ($valueLength != (int) $options['exact']))
			return FALSE;

		return TRUE;
	}
158181
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue(\str_replace(' ', '', (string)$value));
        $this->errors = [];

        if ($this->options['type'] == 'any') {
            $types = \array_keys($this->validationData);
        } elseif (\array_key_exists($this->options['type'], $this->validationData)) {
            $types = [$this->options['type']];
        } else {
            throw new DomainException('Unsopported credit card type: '.$this->options['type']);
        }

        $validType = $this->validateType($types);
        $validNumber = $this->validateNumber();

        return $validType && $validNumber;
    }
1306599
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        return $this->validateDateTime();
    }
265090
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        switch ($this->options['type']) {
            case 'isbn-10':
                $isValid = $this->validateIsbn10();
                break;
            case 'isbn-13':
                $isValid = $this->validateIsbn13();
                break;
            default:
                $isValid = $this->validateAuto();
                break;
        }
        return $isValid;
    }
578355
private static function validateNaturalFloat($key, $value)
    {
        $value = filter_var($value, FILTER_VALIDATE_FLOAT);
        if ($value === false) {
            throw new \InvalidArgumentException("Option[$key] must be float.");
        }
        if ($value < 0.0) {
            throw new \DomainException("Option[$key] must be positive or zero.");
        }
        return $value;
    }
283952
public function filter($value)
    {
        $type = $this->getType();

        // FLOAT (0.0)
        if ($type >= self::TYPE_FLOAT) {
            $type -= self::TYPE_FLOAT;
            if (is_float($value) && ($value == 0.0)) {
                return;
            }
        }

        // STRING ZERO ('0')
        if ($type >= self::TYPE_ZERO_STRING) {
            $type -= self::TYPE_ZERO_STRING;
            if (is_string($value) && ($value == '0')) {
                return;
            }
        }

        // STRING ('')
        if ($type >= self::TYPE_STRING) {
            $type -= self::TYPE_STRING;
            if (is_string($value) && ($value == '')) {
                return;
            }
        }

        // EMPTY_ARRAY (array())
        if ($type >= self::TYPE_EMPTY_ARRAY) {
            $type -= self::TYPE_EMPTY_ARRAY;
            if (is_array($value) && ($value == [])) {
                return;
            }
        }

        // INTEGER (0)
        if ($type >= self::TYPE_INTEGER) {
            $type -= self::TYPE_INTEGER;
            if (is_int($value) && ($value == 0)) {
                return;
            }
        }

        // BOOLEAN (false)
        if ($type >= self::TYPE_BOOLEAN) {
            $type -= self::TYPE_BOOLEAN;
            if (is_bool($value) && ($value == false)) {
                return;
            }
        }

        return $value;
    }
677466
public static function Base64Decode ($value, $options = []) {
		$value = base64_decode($value);

		$to_encoding = isset($options['to_encoding']) ? $options['to_encoding'] : false;
		if ($to_encoding !== false) {
			$from_encoding = isset($options['from_encoding']) ? $options['from_encoding'] : static::DEFAULT_ENCODING;
			return mb_convert_encoding($value, $to_encoding, $from_encoding);
		}

		return $value;
	}
602354
def positivefloat(value):
    
    f = float(not_empty(value))
    if f < 0:
        raise ValueError('float %s < 0' % f)
    return f
42785
public static function uInt(&$value, $options = ['max'=>null, 'min'=>null, 'default'=>null])
    {
        $value = (int)$value;
        self::processUNum($value, $options);
        return $value;
    }