floor()


Syntax

floor(x)

Returns

Number

Description

Rounds the input down to the nearest integer. This function rounds towards zero for positive numbers, but away from zero for negative numbers.

Arguments

  • x (Number): The numerical value or expression to evaluate.

Examples

  • floor(1.9) results in 1.
  • floor(-1.1) results in -2.