Actionscript 3 如何在actionscript 3中将计算结果转换为int?
如何将上面的Actionscript 3 如何在actionscript 3中将计算结果转换为int?,actionscript-3,Actionscript 3,如何将上面的计数转换为整数?如果使用,整数很容易 具体地说,Math.floor(count)将通过丢弃非整数部分来为您提供经典的整数版本,而Math.round(count)将舍入到最接近的整数。不过,我还是建议用Math.floor,因为它可能更接近你的意思。var countInt:int=int(count) 但是Math.round返回一个Number,如何将其转换为int?var countInt:int=int(count); count = "400"/3 - 1;
计数
转换为整数
?如果使用,整数很容易
具体地说,Math.floor(count)将通过丢弃非整数部分来为您提供经典的整数版本,而Math.round(count)将舍入到最接近的整数。不过,我还是建议用Math.floor,因为它可能更接近你的意思。var countInt:int=int(count) 但是
Math.round
返回一个Number
,如何将其转换为int
?var countInt:int=int(count);
count = "400"/3 - 1;