BASE
Converts a number into a text representation with the given radix (base).
Syntax
expression.BASE(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 number to convert. | |
arg2 | Required | ApiRange | ApiName | number | The base radix into which the number will be converted. An integer greater than or equal to 2 and less than or equal to 36. | |
arg3 | Optional | ApiRange | ApiName | number | The minimum length of the returned string. An integer greater than or equal to 0 and less than 256. If omitted, leading zeros are not added to the result. |
Returns
number
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.BASE(5, 2, 5));