Floor
Returns the rounded-down value.
Variants
- Floor(Duration duration, Duration significance)
- Floor(Numeric number)
- Floor(Numeric number, Numeric significance)
- Floor(Time time, Duration significance)
Floor(Duration duration, Duration significance)
Returns the largest multiple of the significance which is less than or equal to the duration.
Parameters
- duration
- The value you want to round.
- significance
- The multiple to which you want to round.
Returns
Duration
Remarks
Note that if the significance is a negative duration, the result is closer to positive infinity than the duration is.
Examples
Floor(Hours(7), Hours(5))
returns 5 hrsFloor(Hours(-7), Hours(5))
returns -10 hrsFloor(Hours(7), Hours(-5))
returns 10 hrsFloor(Hours(-7), Hours(-5))
returns -5 hrs
Floor(Numeric number)
Returns the largest integer less than or equal to the number.
Parameters
- number
- The value you want to round.
Returns
Numeric
Remarks
Note that if the number is a negative fraction, the result is closer to negative infinity than the number is (compare to function Int).
Examples
Floor(4.9)
returns 4Floor(0.9)
returns 0Floor(-4.9)
returns -5Floor(-0.9)
returns -1
Floor(Numeric number, Numeric significance)
Returns the largest multiple of significance which is less than or equal to the number.
Parameters
- number
- The value you want to round.
- significance
- The multiple to which you want to round.
Returns
Numeric
Remarks
Note that if the significance is a negative number, the result is closer to positive infinity than the number is.
Examples
Floor(7, 5)
returns 5Floor(-7, 5)
returns -10Floor(7, -5)
returns 10Floor(-7, -5)
returns -5
Floor(Time time, Duration significance)
Returns the largest multiple of the significance which is less than or equal to the time.
Parameters
- time
- The value you want to round.
- significance
- The multiple to which you want to round.
Returns
Time
Examples
Floor(Time(21, 15), Hours(2))
returns 8:00 PM (or 20:00). 20:00 is the largest multiple of 2, which is less than 21:15