2011-03-26 32 views

回答

1

var countInt:int = int(count);

0

整數很容易,如果你使用math

具體來說,Math.floor(count)將拋出非整數部分給你的經典整數版本,而Math.round(count)將四捨五入到最接近的整數。我建議使用Math.floor,因爲它可能更接近你的意思。

+1

但'Math.round'返回'Number',如何將其轉換爲'int'? – 2011-03-26 15:55:17

+1

var countInt:int = int(count); – 2011-03-26 16:10:11