Math.floor(value) Last updated: 30. May 2026

Always rounds a number downwards.

See also: Math.ceil Math.round Math.random

Parameters

Name Type Description
value number

Value to floor.

Returns

A number that is rounded against floor.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
This becomes 0:
#Math.floor(0.9)#

Output

The #JS code above produces the output shown below:
This becomes 0:
0