标签:str ring func OLE fixed 方法 log code ber
// num要处理的数据,retain保留几位 function keepNum(num, retain) { num = Number(num); num = num.toFixed(retain+1).split("."); num = num[0] + "." + num[1].substring(0, retain); return num; } var num=keepNum(-0.1,6) console.log(num);
标签:str ring func OLE fixed 方法 log code ber
原文地址:https://www.cnblogs.com/Alex-Song/p/12177087.html