코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Math Method</title> </head> <body> <h1>Math.round() 메소드</h1> <script> document.write(Math.round(10.49) + "<br>"); // 10 document.write(Math.round(10.5) + "<br>"); // 11 document.write(Math.round(-10.5) + "<br>"); // -10 document.write(Math.round(-10.51)); // -11 </script> </body> </html>