📜  四舍五入 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.237000             🧑  作者: Mango

代码示例3
using Math.floor

console.log(Math.floor(5.95));
// expected output: 5

console.log(Math.floor(5.05));
// expected output: 5

console.log(Math.floor(5));
// expected output: 5

console.log(Math.floor(-5.05));
// expected output: -6