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
相關文章
相關標籤/搜索