src/BigNum.php
public static function toInt($value)
    {
        if (!static::is($value)) {
            throw new \InvalidArgumentException(
                "The \$value parameter must be numeric (or string representing a big number)."
            );
        }

        if (is_int($value)) {
            return $value;
        } elseif (is_float($value)) {
            return (int)$value;
        }

        if (($decimal = Str::pos($value, '.')) !== false) {
            $value = Str::sub($value, 0, (int)$decimal);
        }

        return $value;
    }
public static function toInt($value)
    {
        if (!static::is($value)) {
            throw new \InvalidArgumentException(
                "The \$value parameter must be numeric (or string representing a big number)."
            );
        }

        if (is_int($value)) {
            return $value;
        } elseif (is_float($value)) {
            return (int)$value;
        }

        if (($decimal = Str::pos($value, '.')) !== false) {
            $value = Str::sub($value, 0, (int)$decimal);
        }

        return $value;
    }
public static function toInt ( $ value ) { if ( ! static :: is ( $ value ) ) { throw new \ InvalidArgumentException ( "The \$value parameter must be numeric (or string representing a big number)." ) ; } if ( is_int ( $ value ) ) { return $ value ; } elseif ( is_float ( $ value ) ) { return ( int ) $ value ; } if ( ( $ decimal = Str :: pos ( $ value , '.' ) ) !== false ) { $ value = Str :: sub ( $ value , 0 , ( int ) $ decimal ) ; } return $ value ; }
Gets the integer value of the given value.

@param float|string $value The value to get the integer value from.

@return int|string Returns the integer value of the given value.
@throws \InvalidArgumentException
Gets the integer value of the given value .