Tabular IQ
Back to Function Index

FLOOR()

Overview

FLOOR() rounds a number down to the nearest value at the specified precision. When no precision is specified, it rounds down to the nearest integer. This function is useful for financial calculations, data analysis, and any scenario where you need to round numbers down to a specific decimal place or significant digit.

Function Format

FLOOR(number [, precision])

Return Value

FLOOR() returns a numeric value

Examples


FLOOR(10.333)                = 10      (rounds down to nearest integer)
FLOOR(-10.333)               = -11     (rounds down to nearest integer)
FLOOR(10.333, 2)             = 10.33   (rounds down to 2 decimal places)
FLOOR(-10.333, 2)            = -10.34  (rounds down to 2 decimal places)
FLOOR(1024, -2)              = 1000    (rounds down to nearest hundred)
FLOOR(3.14159, 3)            = 3.141   (rounds down to 3 decimal places)
FLOOR(1234.5678, -1)         = 1230    (rounds down to nearest ten)

Notes

  • Precision parameter behavior:
    • Positive precision: Rounds to that many decimal places
    • Zero precision: Rounds to the nearest integer
    • Negative precision: Rounds to the nearest power of 10
  • Common use cases include:
    • Financial calculations
    • Data analysis and reporting
    • Price rounding
    • Statistical calculations
    • Unit conversion
  • Important behaviors:
    • Always rounds down, even for negative numbers
    • With negative numbers, the result is more negative
    • With positive numbers, the result is less positive
  • The function can be used with any numeric value, including:
    • Positive numbers
    • Negative numbers
    • Zero
    • Decimal numbers
  • This function is different from ROUND() which rounds to the nearest value, and CEILING() which rounds up.
  • When precision is omitted, the function behaves the same as FLOOR(number, 0).

See Also