Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed the incorrect Round version per SWAT-2695

...

...

...

In this Page

Table of Contents
maxLevel2
excludeAdditional Resources|Related Links|Related Information

Note

Not all supported methods may be in the Functions and Properties drop-down list. If not available, you may type it in.

Table of Contents
minLevel2

abs

Description

Returns the absolute value of a number "x".

This is similar to the JavaScript Math.abs().

Syntax


Code Block
Math.abs(number)


Example

Expression: Math.abs(-1)

Result: 1

ceil

Description

Returns the smallest integer greater than or equal to a number "x".

This is similar to the JavaScript Math.ceil().

Syntax


Code Block
Math.ceil(number)


Example

Expression: Math.ceil(3342.3)

Result: 3343

floor

Description

Returns the largest integer less than or equal to a number "x".

This is similar to the JavaScript Math.floor().

Syntax


Code Block
Math.floor(number)


Example

Expression: Math.floor(3342.3)

Result: 3342


max

Description

Returns the largest number in a series of supplied numbers.

This is similar to the JavaScript Math.max().

Syntax


Code Block
Math.max(value1, value2, ...)


Example

Expression: Math.max(10,12,30)

Result: 30

min

Description

Returns the smallest number in a series of supplied numbers.

This is similar to the JavaScript Math.min().

Syntax


Code Block
Math.min(value1, value2, ...)


Example

Expression: Math.min(10,12,30)

Result: 10

pow

Description

Returns the base to the exponent power.

This is similar to the JavaScript Math.pow().

Syntax


Code Block
Math.pow(base, exponent)


Example

Expression: Math.pow(129, 21.5)

Result: 14427

random

Description

Returns a floating-point, pseudo-random number from 0 (inclusive) up to but not including 1.

This is similar to the JavaScript Math.random().

Syntax


Code Block
Math.random()


Example

Expression: Math.random()

Result: 0.29628396818343006

randomUUID

DescriptionGenerates a random UUID string.
Syntax


Code Block
Math.randomUUID()


Example

Expression: Math.randomUUID()

Result: 2c28e2c0-9767-11e4-9a0d-c3f2b01def6d

...

round

Description

Properties

The following JavaScript constants are supported:

ceil

Expression: Math.sign('x')

Result: NaN

Expression: Math.sign('-5')

Result: -1

Description

Returns the sign of a number, indicating if it is a positive number, negative number, zero, or not a number.

This is similar to the JavaScript Math.sign() except that negative and positive zero are treated as positive zero.

Syntax
Code Block
Math.sign(number)
Example

trunc

...

Returns the integral number, removing any fractional digits.

This is similar to the JavaScript Math.trunc().

...

Code Block
Math.trunc(number)

...

Expression: Math.trunc(14.29)

Result: 14

Returns the smallest integer greater than or equal to a number "x"number of the value rounded off to the nearest integer.

This is similar to the JavaScript Math.ceilround().

Syntax


Code Block
Math.ceilround(numbervalue1)


Example

Expression: Math.ceilround(33423.314159265358979)

Result: 3343

floor

Description

Returns the largest integer less than or equal to a number "x".

This is similar to the JavaScript Math.floor().

Syntax

Code Block
Math.floor(number)
Example

min

Description

Returns the smallest number in a series of supplied numbers.

This is similar to the JavaScript Math.min().

Syntax
Code Block
Math.min(value1, value2, ...)
Example

3

Expression: Math.floorround(3342.3)

Result: 3342

max

...

Returns the largest number in a series of supplied numbers.

This is similar to the JavaScript Math.max().

...

Code Block
Math.max(value1, value2, ...)

...

Expression: Math.max(10,12,30)

Result: 30

.64159265358979)

Result: 4

Expression: Math.min(10,12,30)

Result: 10

pow

...

Returns the base to the exponent power.

This is similar to the JavaScript Math.pow().

...

Code Block
Math.pow(base, exponent)

...

Expression: Math.pow(12,2)

Result: 144

random

...

Returns a floating-point, pseudo-random number from 0 (inclusive) up to but not including 1.

This is similar to the JavaScript Math.random().

...

Code Block
Math.random()

...

Expression: Math.random()

Result: 0.29628396818343006

randomUUID

DescriptionGenerates a random UUID string.
Syntax
Code Block
Math.randomUUID()
Example

Expression: Math.randomUUID()

Result: 2c28e2c0-9767-11e4-9a0d-c3f2b01def6dround(-3.14159265358979)

Result: -3

sign

Description

Returns the sign of a number, indicating if it is a positive number, negative number, zero, or not a number.

This is similar to the JavaScript Math.sign() except that negative and positive zero are treated as positive zero.

Syntax


Code Block
Math.sign(number)


Example

Expression: Math.sign('x')

Result: NaN


Expression: Math.sign('-5')

Result: -1

...

trunc

Description

Returns the integral number, removing any fractional digits.

This is similar to the JavaScript Math.trunc().

Syntax


Code Block
Math.trunc(number)


Example

Expression: Math.trunc(14.29)

Result: 14

Properties

The following JavaScript constants are supported:

...