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
<html><head><title>Math.Floor function demo</title><script>
alert(Math.floor(2.8));
</script></head><body></body></html>
Output