# BASE

## Content

This function converts a number into a text representation according to a specified base.

## Syntax

`BASE(number, radix, [min_length])`

## Arguments

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. <br>If the result is shorter than the specified length, leading zeros are added. |

## Remarks

* 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.

## Data Types

Accepts numeric data. 
Returns string data.

## Examples

```auto
activeSheet.setFormula(0, 0, '=BASE(6,3,2)'); // 20
activeSheet.setFormula(1, 0, '=BASE(15,2,8)'); // 00001111
```