# ROUNDDOWN

**The function ROUNDDOWN rounds a number down to a given decimal place.**

This function takes a two [Numbers](../../variable-data-types/the-number-variable-data-type) as input: a base number to round down, and another number describing which decimal place to round it to. It returns another Number: the given number, rounded down to the specified decimal place.

#### Declaration

```javascript
ROUNDDOWN(base_number, digits) -> rounded_number
```

&#x20;

#### Parameters

**base\_number** (required, type: `Number`) The number to round.

**digits** (required, type: `Number`) The decimal place to round to. This specifies the number of digits that will trail the decimal point once rounding is complete. Giving 0 for the **digits** value results in ROUNDDOWN rounding the base number down to the nearest integer. ROUNDDOWN also accepts negative numbers for **digits**, which specify how to round to a whole number: -1 means ROUNDDOWN will round the base number down to the ten's place, -2 means ROUNDDOWN will round the base number down to the hundred's place, -3 means ROUNDDOWN will round the base number down to the thousand's place, et cetera.

#### Return Values

**rounded\_number** (type: `Number`) The base number rounded down to the given decimal place.

#### Examples

The following example takes the the number 1. 4 and rounds it down to the nearest integer:

```javascript
ROUNDDOWN(1.4, 0) -> 1
```

The following example takes the number 5.8899 and rounds it down to the nearest hundredth. Note that, despite the number occupying the thousandth place in the base number being 9 – the largest number that could possibly occupy it – ROUNDDOWN still rounds down:

```javascript
ROUNDDOWN(5.8899, 2) -> 5.88
```

The following example takes the number 39 and rounds it down to the nearest ten. Note again that the base number is rounded down to 30, despite 39 being much closer, in absolute terms, to 40 than 30:

```javascript
ROUNDDOWN(39, -1) -> 30
```

#### Discussion

As demonstrated above, the ROUNDDOWN function only rounds down. Rounding in the more conventional manner – where whether to round up or down is determined by the rightmost number to the place being rounded to – the [ROUND](round) function is required. To exclusively round up instead of down, use [ROUNDUP](https://github.com/airkit/airkit-docs/blob/master/docs/v18-4/round.mdup).
