解决js计算能力差的问题
//解决js计算能力差的问题
function roundFixed(num, fixed) {
if (isNumeric(num)) {
var pos = num.toString().indexOf('.'),
decimal_places = num.toString().length - pos - 1,
_int = num * Math.pow(10, decimal_places),
divisor_1 = Math.pow(10, decimal_places - fixed),
divisor_2 = Math.pow(10, fixed);
return Math.round(_int / divisor_1) / divisor_2;
} else return num;
}
//兼容VBScript的IsNumeric方法
function isNumeric(vStrInput) {
return (!isNaN(vStrInput));
}

浙公网安备 33010602011771号