Math.round(rndNum)
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> rndNum = Math.random(); rndNum = rndNum * 10; alert(Math.round(rndNum)); </script> </head> <body> </body> </html>