Siebel eScript Language Reference > Siebel eScript Commands > The Math Object >

Math.ceil() Method


This method returns the smallest integer that is not less than its parameter.

Syntax

Math.ceil(number)

Parameter
Description

number

A numeric literal or numeric variable

Returns

The smallest integer that is not less than number; if number is an integer, number.

Usage

This method returns the smallest integer that is not less than number. If the parameter is already an integer, the result is the parameter itself. It returns NaN if number cannot be converted to a number.

Example

The following code fragment generates a random number between 0 and 100 and displays the integer range in which the number falls. Each run of this code produces a different result.

var x = Math.random() * 100;
   TheApplication().RaiseErrorText("The number is between " +
      Math.floor(x) + " and " + Math.ceil(x) + ".");

See Also

Math.floor() Method

Siebel eScript Language Reference