src/BigNum.php
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');
        }
    }
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');
        }
    }
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' ) ; } }
Converts the given number to float.

@param int|float|string $value The value to convert.

@return float|string Returns the value converted to float.
@throws \InvalidArgumentException
Converts the given number to float .