floor()
Table of Contents
Overview
The floor() function takes a decimalValue as an argument, and returns the nearest smallest integer to the given decimal value.
Return Type
- Number
Syntax
<variable> = <decimalValue>.floor();
(OR)
<variable> = floor(<decimalValue> );
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned value. | NUMBER |
<decimalValue> | The nearest smallest integer to this value will be returned. | DECIMAL |
Examples
number = 10.1;
floorValue = number.floor(); // returns 10
floorValue = number.floor(); // returns 10