---
schema_version: "1"
id: 23b5bb2847e3c8eb45caab7f1098cf8e703f2281945fc1cd34508e80d1115797
title: floor({n})
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-math-floor.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-floor.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bf963be0a7b835c105133e9050417330fbdefefdf424c17358ae4d68a6518d5a
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# floor({n})

Returns the nearest integer of equal or lesser value to n. n can be any real numeric value in the range of -1.797e308\<= n \<= 1.797e308.

`floor({n})` takes the following syntax.

```nolang
SELECT floor(COLUMN_NAME) as ALIASNAME
FROM DATASET;
```

## Example

This example returns values in the Discount field rounded down to the nearest integer. In the first three rows, the Discount value is 0. The fourth and fifth values are 0.45 and 0.2, respectively, which are rounded to 0.

```nolang
SELECT floor(Discount) as floorDiscount
FROM Superstore
LIMIT 5;
```

| floorDiscount |
| ------------- |
| 0             |
| 0             |
| 0             |
| 0             |
| 0             |
