<html> <head> <title>Rounding a number to an integer</title> <script type="text/javascript" language="javascript"> <!-- // function f(){ var num1 = 0.3; var num2 = 0.1; var result ; result = num1 / num2; document.write(Math.round(result)); } // --> </script> </head> <body onload="f()">