Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fceil.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fceil.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `ceil`

## Description

Returns the smallest integer greater than or equal to a number. For example, `1.5` becomes `2`, and `8.1` becomes `9`.

## Syntax

Like many functions in DataPrime, `ceil` supports<!-- --> [two notations](https://docs-docusaurus.kinsta.page/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
ceil(number: number): number
```

```
(number: number).ceil(): number
```

## Arguments

| Name     | Type     | Required | Description                      |
| -------- | -------- | -------- | -------------------------------- |
| `number` | `number` | **true** | A numeric expression to round up |

## Example

**Use case: Calculate required SaaS licenses**

When averaging license usage over time, results may include decimals. Since fractional licenses cannot be purchased, `ceil` ensures the number is rounded up to the nearest integer.

### Example data

```
{

    "total_licenses": 100,

    "licenses_in_use": 31,

    "timestamp": "2024-10-10T21:00:00Z"

},

{

    "total_licenses": 100,

    "licenses_in_use": 35,

    "timestamp": "2024-10-11T21:00:00Z"

},

{

    "total_licenses": 100,

    "licenses_in_use": 22,

    "timestamp": "2024-10-12T21:00:00Z"

},

{

    "total_licenses": 100,

    "licenses_in_use": 54,

    "timestamp": "2024-10-13T21:00:00Z"

}
```

### Example query

* Function notation
* Method notation

```
aggregate ceil(avg(total_licenses)) as licenses_needed
```

```
aggregate total_licenses.avg().ceil() as licenses_needed
```

### Example output

```
{

    "licenses_needed": 36

}
```
