CONVERT
Converts a number from one measurement system to another.
Syntax
expression.CONVERT(arg1, arg2, arg3);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | The value in the specified units to be converted. | |
arg2 | Required | ApiRange | ApiName | string | The original measurement unit. | |
arg3 | Required | ApiRange | ApiName | string | The units for the result. |
Returns
number
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.CONVERT(2, "Ibm", "kg"));