关于保留计算结果有效位数的问题
我编写了一个页面,在第一个文本框和第二个文本框中输入数字,当点击第三个文本框时显示两个文本框的相除结果,结果中小数点位数是可以选择的。 
 例如:第一个文本框“1”,第二个文本框“3”,第三个文本框时显示“0.33” 
 请问下面程序如何修改可以实现上述要求 
  <%@LANGUAGE= "JAVASCRIPT "   CODEPAGE= "936 "%>  
  <!DOCTYPE   html   PUBLIC    "-//W3C//DTD   XHTML   1.0   Transitional//EN "    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  
  <html   xmlns= "http://www.w3.org/1999/xhtml ">  
  <head>  
  <meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />  
  <title> 无标题文档 </title>  
  </head>  
  <script   language= "JavaScript "   >  
 function   add() 
 {       
          var   m=Number(document.getElementById( "textfield ").value) 
          var   n=Number(document.getElementById( "textfield2 ").value) 
          document.getElementById( "textfield3 ").value=   m/n 
 } 
  </script>  
  <body>  
  <label>  
  <input   type= "text "   name= "textfield "   />  
  </label>  
  <p>  
        <label>  
        <input   type= "text "   name= "textfield2 "   />  
        </label>  
  </p>  
  <p>  
        <label>  
        <input   type= "text "   name= "textfield3 "   onclick= "add() "/>  
        </label>  
  </p>  
  </body>  
  </html>  
------解决方案--------------------function add() 
 {   
    var m=Number(document.getElementById( "textfield ").value) 
    var n=Number(document.getElementById( "textfield2 ").value) 
    var result = m / n; 
    document.getElementById( "textfield3 ").value= result.toFixed(2); 
 } 
------解决方案--------------------document.getElementById( "textfield3 ").value= (m/n).toFixed(2);