开发者

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

开发者 https://www.devze.com 2023-02-20 04:06 出处:网络
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!
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

精彩评论

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