FLOOR

Rounds a number (toward negative infinity) to a multiple of another number

Usage

FLOOR(number, [multiple_of])

Parameters

number

(Required) The number

multiple_of

The multiple to round to (by default 1). If number is negative, then multiple_of can be negative to inverse the rounding. (So to round toward zero)

Examples

Example With these variables Result

FLOOR(10)

(None)

10

FLOOR(10.1)

(None)

10

FLOOR(number)

number is -3.3

-4

FLOOR(11.9, 2)

(None)

10

FLOOR(11.9, 0.5)

(None)

11.5

FLOOR(-10.1, 0.5)

(None)

-10.5

FLOOR(-10.1, -0.5)

(None)

-10

More information

If number is already a multiple of multiple_of, then number is returned as is.

Reminders

A text containing digits is not handled as a number. To have an actual number:

  • use the @NUMBER_QUESTION to set the variable
  • write a numeric value directly in the code without quotes, ex: age >= 18
  • use a function which converts to a number: NUMBER(text_containing_numbers)
  • use a function which returns a number: FIND("world", "hello everybody")

See also