标签:浮点 function math ber pre tip fun string ++
/*by xxx*/ accurateMultiply: function () { var args = arguments, fixNumber = 1, n = 0, arg; for (var i = 0; i < args.length; i++) { arg = args[i].toString(); n += (arg.split(‘.‘)[1] ? arg.split(‘.‘)[1].length : 0); fixNumber = fixNumber * Number(arg.replace(‘.‘, ‘‘)); } return fixNumber / (Math.pow(10, n)); }
标签:浮点 function math ber pre tip fun string ++
原文地址:https://www.cnblogs.com/yipinGG-8/p/11988324.html