# floor

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: floor
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/math-functions/floor
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/math-functions/floor.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/math-functions/floor.adoc
description: The `floor()` returns a number rounded down that is less than or equal to the specified argument.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/floor.md -->

The `floor()` returns a number rounded down that is less than or equal to the specified argument.

## [](#syntax)Syntax

The syntax for the `floor()` function in Redpanda SQL is:

```sql
FLOOR(x)
```

The `floor()` function requires one argument:

`x`: A positive or a negative decimal number (or an expression that evaluates to a decimal number).

## [](#examples)Examples

### [](#round-down-a-positive-decimal-value)Round down a positive decimal value

This example demonstrates how the `floor()` function rounds down a positive decimal value:

```sql
SELECT FLOOR(345.6765467);
```

This returns 345 as it is the closest value smaller than the argument.

```sql
+------+
| f    |
+------+
| 345  |
+------+
```

### [](#round-down-a-negative-decimal-value)Round down a negative decimal value

This example demonstrates how the `floor()` function rounds down a negative decimal value:

```sql
SELECT FLOOR(-0.987657);
```

The result is the nearest integer smaller than or equal to the specified argument.

```sql
+-------+
| f     |
+-------+
| -1    |
+-------+
```

### [](#use-the-floor-function-with-a-table)Use the `floor()` function with a table

This example demonstrates how to use the `floor()` function with a table to round down values in a specific column:

1.  Create a new table called **FloorRecords** with double-precision values:

    ```sql
    CREATE TABLE FloorRecords (numbers float);
    INSERT INTO FloorRecords VALUES (3.987), (4.325), (-0.76), (-22.57);
    ```

2.  Retrieve the table with its values:

    ```sql
    SELECT * ,FLOOR(numbers) AS Floorvalue FROM FloorRecords;
    ```

3.  Result:

    -   **numbers,** the column with the initial double-precision values.

    -   **FloorValue**, the column with the rounded-down values.

        ```sql
        +------------+---------------+
        | numbers    | Floorvalue    |
        +------------+---------------+
        | 3.987      | 3             |
        | 4.325      | 4             |
        | -0.76      | -1            |
        | -22.57     | -23           |
        +------------+---------------+
        ```