Lingo Dictionary > G-K > integer()

 

integer()

Syntax

(numericExpression).integer
integer(numericExpression)

Description

Function; rounds the value of numericExpression to the nearest whole integer.

You can force an integer to be a string by using the string() function.

Example

This statement rounds off the number 3.75 to the nearest whole integer:

put integer(3.75)
-- 4

Example

This statement rounds off the value in parentheses. This provides a usable value for the locH sprite property, which requires an integer:

sprite(1).locH = integer(0.333 * stageWidth)

See also

float(), string()