JS 中 format() 和 toFixed() 的使用 一.toFixed(n)方法:保留n位小数 //把1314修改为1.314 let num1 = 1314 console.log((num1/1000).toFixed(1)) //打印1.3