[]
This function converts a number into a text representation according to a specified base.
BASE(number, radix, [min_length])
This function has the following arguments:
Argument | Description |
|---|---|
number | A nonnegative integer to convert. The value must be less than 2^53. |
radix | An integer from 2 through 36 that specifies the base of the returned text. |
min_length | [Optional] A nonnegative integer that specifies the minimum length of the returned text. If the result is shorter than the specified length, leading zeros are added. |
If an argument contains a decimal value, it is truncated to an integer.
If number is negative or greater than or equal to 2^53, the function returns the #NUM! error.
If radix is less than 2 or greater than 36, the function returns the #NUM! error.
If minLength is negative, the function returns the #NUM! error.
If the converted value is longer than minLength, the function returns the complete value without truncating it.
The returned value is text.
Accepts numeric data.
Returns string data.
activeSheet.setFormula(0, 0, '=BASE(6,3,2)'); // 20
activeSheet.setFormula(1, 0, '=BASE(15,2,8)'); // 00001111