js如何判断小数点后有几位? <script> var n=3.14 if(n.toString().split(".")[1].length>3)alert("大于3") else alert(n.toFixed(3)) </script>