Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Get float value of a variable
Alias doubleval
<?php floatval(mixed $value): float
<?php     public function float($key, $default = 0.0)

    {

        return floatval($this->input($key, $default));

    }
<?php         }



        switch (true) {

            case floatval($number) === 0.0:

                return $precision > 0 ? static::format(0, $precision, $maxPrecision) : '0';

            case $number < 0:

                return sprintf('-%s', static::summarize(abs($number), $precision, $maxPrecision, $units));
<?php     public function toFloat()

    {

        return floatval($this->value);

    }
<?php             return $size;

        }



        $value = floatval($size);



        return round(match (true) {

            Str::endsWith($size, 'kb') => $value * 1,