Garry's Mod Wiki

math.floor

  number math.floor( number number )

Description

Floors or rounds a number down.

Arguments

1 number number
The number to be rounded down.

Returns

1 number
floored numbers

Example

Round pi.

print(math.floor(math.pi))
Output: 3

Example

Demonstrates the difference between math.Round and math.floor.

local value = 3.6 print( math.Round( value ), math.floor( value ) )
Output: 4 3