Skip to content
drewmccluskey edited this page Jan 8, 2019 · 3 revisions

floor

This function will round an input decimal down.

Syntax:

floor(val)
Argument Description
double val The value to round down

Returns: int

Description:

This function will round an input decimal down, it is similar to round(); but instead will always round down compared to the nearest whole number.

Example:

double numberToRoundDown = 5.9999;
var RoundedNumberDown = floor(numberToRoundDown); //return 5

This code will round down double numberToRoundDown with value 5.9999 to var RoundedNumberDown with value 5.

Back to number_functions

Clone this wiki locally