js取整数、取余数的方法

1.丢弃小数部分,保留整数部分javascript parseInt(5/2)java 2.向上取整,有小数就整数部分加1dom  Math.ceil(5/2)spa 3,四舍五入.code Math.round(5/2)对象 4,向下取整ip  Math.floor(5/2)get Math 对象的方法 FF: Firefox, N: Netscape, IE: Internet Explore
相关文章
相关标签/搜索