TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

CONVERT

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

Converts a number from one measurement system to another.

Parameters:

Name Type Description
arg1 any

Is the value in from_units to convert.

arg2 any

Is the units for number.

arg3 any

Is the units for the result.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.CONVERT(2, "Ibm", "kg"));
builder.SaveFile("xlsx", "CONVERT.xlsx");
builder.CloseFile();

Resulting document