Math.ceil() Javascript
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p id="result"></p> <button onclick="myFunction()">Run</button> <script> function myFunction() { var content = "-3.6 ~ " + Math.ceil(-3.6) + '<br>'; content += "-2.5 ~ " + Math.ceil(-2.5) + '<br>'; content += "3.31 ~ " + Math.ceil(3.31) + '<br>'; document.getElementById("result").innerHTML = content; } </script> </body> </html>
PHÓNG TO