跳到主要内容

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

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe number to convert.
arg2RequiredApiRange | ApiName | numberThe base radix into which the number will be converted. An integer greater than or equal to 2 and less than or equal to 36.
arg3OptionalApiRange | ApiName | numberThe 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

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.BASE(5, 2, 5));