开发者

How to convert the calculating result to int in actionscript 3?

count = "400"/3 - 1;

How to convert the above count t开发者_JS百科o int?


var countInt:int = int(count);


Integers are easy if you use math!

Specifically, Math.floor(count) will give you the classic integer version of this by throwing away the non-integer part, while Math.round(count) will round to the nearest integer. I'd suggest going with Math.floor though as it's probably closer to what you mean.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜