2007年4月27日 星期五

JavaScript 取得整數

JavaScript 取得整數 語法:

Math.floor(5.1)

結果會得到 5

Math.ceil 無條件進位
Math.floor 無條件捨去
Math.round 四捨五入

沒有留言: