' Math.floor(x)restituisce il valore di x arrotondato verso il basso al suo intero piu' vicino:
https://www.w3schools.com/js/tryit.asp?filename=tryjs_math_floor <!DOCTYPE html> <html> <body> <h2>JavaScript Math.floor()</h2> <p>Math.floor(x) returns the value of x rounded <strong>down</strong> to its nearest integer:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = Math.floor(4.7); </script> </body> </html> |