執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
轉到 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Math</h1> <h2>The Math.round() Method</h2> <p>Math.round() rounds a number to the nearest integer:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = Math.round(2.5); </script> </body> </html>