August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.floor(num)
The floor() method of the Math object is used to get the largest integer number, which is equivalent to or less than the number passed as the parameter.
Listing 6.160 shows how the floor() method is used.
<html> <body> <script language="JavaScript"> <!–– Hide // function calculates the floor of to input number function doMath(){ var inputNum=document.form1.input.value; var result = Math.floor(inputNum); document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> This example calculates the floor of the number entered. <br><br> Enter First ... |
Read now
Unlock full access