floor

math

Rounds down to the nearest integer

Syntax

floor(number)

Parameters

number (number)

The number to round down

Returns

number

The largest integer less than or equal to the input

Examples

Input:
3.7 | floor
Output:
3
Input:
-2.3 | floor
Output:
-3
Input:
floor(5.9)
Output:
5

The floor() function rounds down to the nearest integer, always moving toward negative infinity.

Usage

Use floor() when you need to round down values, such as calculating whole units or binning data into integer ranges.

Related Functions