Float Library

The Float library contains functions used to manipulate floating point numbers.

ceil

Description: This function returns the smallest integer not less than the specified value.

Syntax: Float.ceil(value)

Example: The following example converts a floating point number to the smallest integer value not less than itself:

// Convert to integer
var b=Float.ceil(a);

floor

Description: This function returns the largest integer not greater than the specified value.

Syntax: Float.floor(value)

Example: The following example converts a floating point number to the largest integer value not greater than itself:

// Convert to integer
var b=Float.floor(a);

int

Description: Returns the integer portion of floating-point value.

Syntax: Float.int(value) ...

Get WAP Development with WML and WMLScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.