Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')
    {
        $realNumber = ($realNumber === null) ? 0.0 : Functions::flattenSingleValue($realNumber);
        $imaginary = ($imaginary === null) ? 0.0 : Functions::flattenSingleValue($imaginary);
        $suffix = ($suffix === null) ? 'i' : Functions::flattenSingleValue($suffix);

        if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
            (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))
        ) {
            $realNumber = (float) $realNumber;
            $imaginary = (float) $imaginary;

            if ($suffix == '') {
                $suffix = 'i';
            }
            if ($realNumber == 0.0) {
                if ($imaginary == 0.0) {
                    return (string) '0';
                } elseif ($imaginary == 1.0) {
                    return (string) $suffix;
                } elseif ($imaginary == -1.0) {
                    return (string) '-' . $suffix;
                }

                return (string) $imaginary . $suffix;
            } elseif ($imaginary == 0.0) {
                return (string) $realNumber;
            } elseif ($imaginary == 1.0) {
                return (string) $realNumber . '+' . $suffix;
            } elseif ($imaginary == -1.0) {
                return (string) $realNumber . '-' . $suffix;
            }
            if ($imaginary > 0) {
                $imaginary = (string) '+' . $imaginary;
            }

            return (string) $realNumber . $imaginary . $suffix;
        }

        return Functions::VALUE();
    }
public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')
    {
        $realNumber = ($realNumber === null) ? 0.0 : Functions::flattenSingleValue($realNumber);
        $imaginary = ($imaginary === null) ? 0.0 : Functions::flattenSingleValue($imaginary);
        $suffix = ($suffix === null) ? 'i' : Functions::flattenSingleValue($suffix);

        if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
            (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))
        ) {
            $realNumber = (float) $realNumber;
            $imaginary = (float) $imaginary;

            if ($suffix == '') {
                $suffix = 'i';
            }
            if ($realNumber == 0.0) {
                if ($imaginary == 0.0) {
                    return (string) '0';
                } elseif ($imaginary == 1.0) {
                    return (string) $suffix;
                } elseif ($imaginary == -1.0) {
                    return (string) '-' . $suffix;
                }

                return (string) $imaginary . $suffix;
            } elseif ($imaginary == 0.0) {
                return (string) $realNumber;
            } elseif ($imaginary == 1.0) {
                return (string) $realNumber . '+' . $suffix;
            } elseif ($imaginary == -1.0) {
                return (string) $realNumber . '-' . $suffix;
            }
            if ($imaginary > 0) {
                $imaginary = (string) '+' . $imaginary;
            }

            return (string) $realNumber . $imaginary . $suffix;
        }

        return Functions::VALUE();
    }
COMPLEX.

Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.

Excel Function:
COMPLEX(realNumber,imaginary[,places])

@category Engineering Functions

@param float $realNumber the real coefficient of the complex number
@param float $imaginary the imaginary coefficient of the complex number
@param string $suffix The suffix for the imaginary component of the complex number.
If omitted, the suffix is assumed to be "i".

@return string