Articles → JavaScript → Math.Floor Function In Javascript
Math.Floor Function In Javascript
Purpose
| Number | Rounding downward to nearest integer |
|---|
| 1.8 | 1 |
| 2.5 | 2 |
| 3.2 | 3 |
Example
<script>
alert(Math.floor(2.8));
</script>
Try It
Output
| Posted By - | Karan Gupta |
| |
| Posted On - | Friday, May 8, 2020 |