2011-03-26 29 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