let num1 = 3.141596
let num2 = 18.58
let num3 = -16.06
let num4 = -16.58
let num5 = 0.34
let num6 = 8.54
const round1 = Math.floor(num1)
const round2 = Math.floor(num2)
const round3 = Math.floor(num3)
const round4 = Math.floor(num4)
const round5 = Math.floor(num5)
const round6 = Math.floor(num6)
const round7 = Math.floor(num6*100)/100
console.log({round1},{round2},{round3},{round4},{round5},{round6},{round7})
//{ round1: 3 } { round2: 18 } { round3: -17 } { round4: -17 } { round5: 0 } { round6: -1 } { round7: 8.53 }
//【注】Math.floor() 容易出现精度问题 let num6 = 8.54(已保留2位小数),Math.floor(num6*100)/100 输出的结果是8.53