<script>
alert(Math.round(123.466 * 10) / 10)
</script>

解决方案 »

  1.   

    <script>
    a = 123.466
    alert(a.toFixed(1));
    </script>ie5不支持toFixed方法可以定义一个
    try {
      (1).toFixed(1);
    }
    catch(e) {
      Number.prototype.toFixed = function(dot) {
        with(Math){
          var m=pow(10,Number(dot))
          var s = (round(this*m)/m).toString();
        }
        if(s.indexOf('.') < 0)
           s += ".";
        s += "000000000000";
        return s.substr(0,s.indexOf('.')+dot+1)+"a";
      }
    }