<script>
var num = 3.7*3
//方法1:
alert(num+"保留小数点后两位是:"+(num).toFixed(1)) //IE5.5+自带//方法2:
function Number.prototype.Fixed(n){
with(Math){var tmp=pow(10,n);return round(this*tmp)/tmp;}
}
alert(num+"保留小数点后两位是:"+num.Fixed(1));
</script>