public function convert($number)
    {
        $integer = (string) $number;
        $fractions = null;
        $sign = '';

        if (in_array(substr($integer, 0, 1), ['+', '-'], true)) {
            $sign = $integer[0];
            $integer = substr($integer, 1);
        }

        if (($pos = strpos($integer, '.')) !== false) {
            $fractions = substr($integer, $pos + 1);
            $integer = substr($integer, 0, $pos);
        }

        return $this->convertNumber($sign, $integer, $fractions);
    }
public function convert($number)
    {
        $integer = (string) $number;
        $fractions = null;
        $sign = '';

        if (in_array(substr($integer, 0, 1), ['+', '-'], true)) {
            $sign = $integer[0];
            $integer = substr($integer, 1);
        }

        if (($pos = strpos($integer, '.')) !== false) {
            $fractions = substr($integer, $pos + 1);
            $integer = substr($integer, 0, $pos);
        }

        return $this->convertNumber($sign, $integer, $fractions);
    }
public function convert ( $ number ) { $ integer = ( string ) $ number ; $ fractions = null ; $ sign = '' ; if ( in_array ( substr ( $ integer , 0 , 1 ) , [ '+' , '-' ] , true ) ) { $ sign = $ integer [ 0 ] ; $ integer = substr ( $ integer , 1 ) ; } if ( ( $ pos = strpos ( $ integer , '.' ) ) !== false ) { $ fractions = substr ( $ integer , $ pos + 1 ) ; $ integer = substr ( $ integer , 0 , $ pos ) ; } return $ this -> convertNumber ( $ sign , $ integer , $ fractions ) ; }
Converts the number provided as a string from source base to target base.

This method provides convenient conversions by accepting the number as
a string. The number may optionally be preceded by a plus or minus sign
which is prepended to the result as well. The number may also have a
period, which separates the integer part and the fractional part.

Due to the special meaning of `+`, `-` and `.`, it is not recommended to
use this method to convert numbers when using number bases that have a
meaning for these characters (such as base64).

If the number contains invalid characters, the method will return false
instead.

@param string $number The number to convert
@return string|false The converted number or false on error
Converts the number provided as a string from source base to target base .