|Math.floor( number) ;|
Description of code:
We have created an input text box in which user can provide the number of which we have to calculate the floor value. When user clicks on the button "Show Floor value" it calls the method callFloor() . In the callFloor() method it takes the number from the text box and shows the floor value in the alert message by using the alert() method. Here is the full example code of floorExample.html as follows:
var val= document.getElementById("txt").value;
<div style="background: #cf2255; width:'100%';" align="center">
<font color="#ffffcc" size="12pt">
<div style="background: #ffffcc; width:'100%';" align="center">
Input any decimal number(9999.9999) :<input type="text" id="txt" value=""/>
<button onclick="callFloor();">Show Floor Value</button>
Input any number to find its floor value.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.