TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

COMPLEX

COMPLEX(arg1, arg2, arg3) → { number | string | boolean }

Converts real and imaginary coefficients into a complex number.

Parameters:

Name Type Description
arg1 any

Is the real coefficient of the complex number.

arg2 any

Is the imaginary coefficient of the complex number.

arg3 any

Is the suffix for the imaginary component of the complex number.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.COMPLEX(-2, 2.5, "i"));
builder.SaveFile("xlsx", "COMPLEX.xlsx");
builder.CloseFile();

Resulting document