js两个数字类型的数据相加出现过多小数位

//直接转化
var val = Number(value) + Number(item);
if(!isNaN(parseFloat(val))) {
val = val.toFixed(2);
}