微信小程序 无限循环数字截取

42 阅读1分钟

参考自:blog.csdn.net/weixin_4199…

parseFloat(item.averageProcess).toFixed(3);

其中item.averageProcess 为无限循环长度数字,先用parseFloat,拿到大概相近数字,再使用toFixed截取