取整去掉小数
parseInt(5/2)
向上取整,有小数就整数部分加1
Math.ceil(5/2)
向下取整
Math.floor(5/2)
四舍五入
Math.round(5/2)
绝对值
abs(x)
js Math()函数
猜你喜欢
转载自blog.csdn.net/Mh_ui/article/details/79753022
今日推荐
周排行