floatP()
317
float()
Usage
(
expression
).float
float (
expression
)
Description
Function (Lingo only); converts an expression to a floating-point number. The number of digits
that follow the decimal point (for display purposes only, calculations are not affected) is set using
the
floatPrecision
property.
In JavaScript syntax, use the
parseFloat()
function.
Parameters
expression
Required. The expression to convert to a floating-point number.
Example
This statement converts the integer 1 to the floating-point number 1:
put (1).float
-- 1.0
Math operations can be performed using
float
; if any of the terms is a
float
value, the entire
operation is performed with
float
:
"the floatPrecision = 1
put 2 + 2
-- 4
put (2).float + 2
-- 4.0
the floatPrecision = 4
put 22/7
-- 3
put (22).float / 7
-- 3.1429"
See also
floatPrecision
,
ilk()
floatP()
Usage
(
expression
).floatP
floatP(
expression
)
Description
Function (Lingo only); indicates whether an expression is a floating-point number (1 or
TRUE
) or
not (0 or
FALSE
).
The
P
in
floatP
stands for
predicate
.
Parameters
expression
Required. The expression to test.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...