Flash Lite 1.x ActionScript 语言参考 |
|
|
|
| Flash Lite 全局函数 > int() | |||
Flash Lite 1.0。
int(value)
value 一个要截断为整数的数字或字符串。
函数;将小数截断为整数值。
以下示例将截断 distance 和 myDistance 变量中的数字:
distance = 6.04 - 3.96;
//trace ("distance = " add distance add " and rounded to:" add int(distance));
// 输出:distance = 2.08 and rounded to: 2
myDistance = "3.8";
//trace ("myDistance = " add int(myDistance));
// 输出:3
|
|
|
|