Math function

This topic provides the Math functions available for an Expression activity.

Function

Returns

Description

Integer(number)

Number

Returns the integer part of a specified number.

RandomBetween(number, number)

Number

Gets a random number between or equal to two specified values.

RoundDown(number)

Number

Rounds a value down.

For example, if you set the value as 13.2, the function rounds the value to 13. For 13.5, 13.6, or higher, the function rounds the value to 14.

RoundUp(number)

Number

Rounds a value up.

The result of rounding a value up is similar to rounding a value down.

Pow(number, number)

Number

Calculates a number raised to a specified power.

Round(number, number)

Number

Rounds the value to the given number of decimal places.This function accepts both inputs, that is value and number of decimal places.

Examples if the number of decimal places is 1:

  • For (13.2,1) or (13.22,1) the functions rounds the value to 13.2.

  • For (13.25,1) or (13.250,1), the function rounds to 13.2.

  • For (13.256,1), the result becomes 13.3.

Examples if the number of decimal places is 2:

  • For (13.225,2), the functions rounds the value to 13.22.

  • For (13.251,2) the result becomes 13.25.

  • For (13.335,2), the result becomes 13.34.

Abs(number)

Number

Returns the absolute value of a number.