js乘法计算精度
1 function accMul(arg1, arg2) { 2 var m = 0, 3 s1 = arg1.toString(), 4 s2 = arg2.toString(); 5 try { 6 m += s1.split(".")[1].length 7 } catch (e) {} 8 try { 9 m += s2.split(".")[1].length 10 } catch (e) {} 11 return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m) 12 }