int()

可用性

Flash Lite 1.0。

用法

int(value)

Operands

value 一个要截断为整数的数字或字符串。

说明

函数;将小数截断为整数值。

示例

以下示例将截断 distancemyDistance 变量中的数字:

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