---
page_title: floor function reference
description: |-
  The `floor` function returns the closest whole number less than or equal to
  the given value. 
---

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
> [!IMPORTANT]  
> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

# `floor` Function

`floor` returns the closest whole number that is less than or equal to the
given value, which may be a fraction.

## Examples

```shell-session
> floor(5)
5
> floor(4.9)
4
```

## Related Functions

- [`ceil`](/packer/docs/templates/hcl_templates/functions/numeric/ceil), which rounds to the nearest whole number _greater than_
  or equal.
