Berserk Docs
Scalar FunctionsMath Functions

floor

Rounds values down to a fixed-size bin. Equivalent to bin(). Accepts numeric, datetime, and timespan values.

Syntax

floor(value, round_to)

Parameters

Prop

Type

Returns: dynamic

Examples

Example 1

print floor(3.14159, 0.01)
print_0 (real)
3.14

Example 2

print floor(- 50.55, 10)
print_0 (real)
-60.0

Example 3

print floor(datetime(2024-06-08 14:30:00), 1d)
print_0 (datetime)
2024-06-08T00:00:00Z

Example 4

print floor(1h, 15m)

On this page