Floor - script and chart function
Floor() rounds down a number to the nearest multiple of the specified step interval. The result is decreased by the value of offset, if one is specified, or increased if offset is negative.
Compare with the ceil function, which rounds input numbers up.
Syntax:
Floor(x[, step[, offset]])
Return data type: numeric
Examples and results:
Examples | Results |
---|---|
Floor( 2,4 ) |
Returns 0 |
Floor( 4,2 ) |
Returns 4 |
Floor( 3.88 , 0.1 ) |
Returns 3.8 |
Floor( 3.88 , 5 ) |
Returns 0 |
Floor( 1.1 , 1 ) |
Returns 1 |
Floor( 1.1 , 1 , 0.5 ) |
Returns 0.5 |