如何在Javascript中舍入一个数字?
问题描述:
如何在JavaScript中舍入数字?
How can I round down a number in JavaScript?
math.round()
不起作用因为它将它舍入到最接近的小数。
math.round()
doesn't work because it rounds it to the nearest decimal.
我不确定是否有更好的方法可以做到这一点,除了在保持第一位的小数点分开。必须有......
I'm not sure if there is a better way of doing it other than breaking it apart at the decimal point at keeping the first bit. There must be...
答
Math.floor()
就是答案。