Math functions

Math functions available are useful for calculating values based on numerical data. For example, calculating total sales from multiple items.

TotalAgility supports the following math functions.

Function

Returns

Description

Integer(number)

Number

Converts a number to an integer by truncating decimal places.

RandomBetween(number, number)

Number

Generates a random number between two specified values.

RoundDown(number)

Number

Rounds a number down to the nearest integer.

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 number up to the nearest integer.

Pow(number, number)

Number

Returns a number raised to a specified power.

Round(number, number)

Number

Rounds a number to specific decimal places.

For example, 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.

For example, 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.