js截取小数点后几位的写法_javascript技巧:如果${showInfo.tt}的值为20,要要它除以10以后精确到小数点后2位,那么js代码中可作如下写法: 代码如下: var a = ${showInfo.tt}/10; //alert(a.toFixed(3)); //表示到小数点后3位得出的值为2.000 document.write(a.toFixe
导读js截取小数点后几位的写法_javascript技巧:如果${showInfo.tt}的值为20,要要它除以10以后精确到小数点后2位,那么js代码中可作如下写法: 代码如下: var a = ${showInfo.tt}/10; //alert(a.toFixed(3)); //表示到小数点后3位得出的值为2.000 document.write(a.toFixe
如果${showInfo.tt}的值为20,要要它除以10以后精确到小数点后2位,那么js代码中可作如下写法: 代码如下: var a = ${showInfo.tt}/10; //alert(a.toFixed(3)); //表示到小数点后3位得出的值为2.000 document.write(a.toFixed(2)); //得出的值为2.00
js截取小数点后几位的写法_javascript技巧
js截取小数点后几位的写法_javascript技巧:如果${showInfo.tt}的值为20,要要它除以10以后精确到小数点后2位,那么js代码中可作如下写法: 代码如下: var a = ${showInfo.tt}/10; //alert(a.toFixed(3)); //表示到小数点后3位得出的值为2.000 document.write(a.toFixe