Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Math Object >
Math.round() Method
This method rounds a number to its nearest integer.
Syntax
Math.round(number)
Returns
The integer closest in value to number.
Usage
The number parameter is rounded up if its fractional part is equal to or greater than 0.5 and is rounded down if less than 0.5. Both positive and negative numbers are rounded to the nearest integer.
Example
This code fragment yields the values 124 and -124.
var a = Math.round(123.6);
var b = Math.round(-123.6)
TheApplication().RaiseErrorText(a + "\n" + b)See Also
Clib.modf() Method, ToInt32() Method, ToInteger() Method, ToUint16() Method, and ToUint32() Method
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference Published: 18 April 2003 |