Math.round() 四捨五入 Math.round(3.14) // 3Math.round(5.49999) // 5Math.round(5.5) // 6Math.round(“5.50001”) // 6Math.round(-5.49999) // -5Math.round(-5.5) // -5Math.round(-5.50001) // -6 Math.round(18.62645 * 10) / 10 // 18.6Math.round(18.62645 * 100) / 100 // 18.63Math.round(18.62645 * 1000) / 1000 // 18.626 Math.floor() 最大整數 取小於這個數的最大整數 Math.floor(3.14) // 3Math.floor(5.4) // 5Math.floor(-5.4) // -6Math.floor(“-5.5”) // -6 Math.ceil() 最小整數 取大於這個數的最小整數 Math.ceil(3.14) // 4Math.ceil(5.4) // 6Math.ceil(-5.4) // -5Math.ceil(“-5.5”) […]