Math
(Available from version 7.0 onwards.)
Functions
Calculates the sum of two decimals.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
decimal |
Decimal |
The first decimal to add. |
decimal |
Decimal |
The second decimal to add. |
Returns
Returns the result as a decimal.
Example
This example sums two decimal values (5.25 and 6.11) and stores the result in the decimal variable add_decimal_response.
In debug mode, the value of add_decimal_response is shown as 11.36.
Calculates the sum of two numbers (integers).
Add Numbers is particularly useful for incrementing an index counter in For-Each loops (see Example 2 below) and in workflow loops (see Example 3 below).
Parameters
Parameter |
Input Type |
Description |
---|---|---|
number |
Number |
The first number to add. |
number |
Number |
The second number to add. |
Returns
Returns the result as a number.
Example 1
This example sums two number values (11 and 5) and stores the result in the number variable add_numbers_response.
In debug mode, the value of add_numbers_response is shown as 16.
Example 2
The workflow below creates one text file for each customer in the list Customers. The files are named with sequential numbers from 1 onward.
Specifically:
-
The number variable Counter is assigned the value 1.
-
A For-Each loop cycles through the Customers list.
-
For each customer, a file named with the value of Counter is created and the customer's name is written to the file.
-
The number variable Counter is incremented by 1 using the Add Number function.
The files are created as required:
Example 3
This example shows how Add Numbers is used to increment the counter used to ensure that a series of workflow steps are performed a specified number of times.
Calculates the average value of a list of decimals.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list containing the decimals to be averaged. |
Returns
Returns the result as a decimal.
Example
This example averages the list of type decimal LVDecimal001, and returns the calculated value into the variable SVDecimal001.
Calculates the average value of a list of numbers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list containing the numbers to be averaged. |
Returns
Returns the result as a decimal.
Example
This example calculates the average of the list LVNumber001, and returns the calculated value into the variable SVDecimal001
Return the closest integer that is equal to or larger than the specified decimal. For example, the Ceiling of 1.2 is 2.0. The output is returned as a decimal value.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
decimal |
Decimal |
The decimal value to find a ceiling of. |
Returns
Returns a decimal value.
Example
This workflow calculates the ceiling of the decimal variable decValue which has been set to 5.2, and stores it in the decimal variable ceiling_decValue.
When executed, ceiling_decValue is set to 6.0.
Calculates the cosine of a decimal value representing degrees.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
degrees |
Decimal |
The angle in degrees. |
Returns
Returns the result as a decimal.
Example
This example calculates the cosine of 30 degrees and returns 0.8660 into the decimal variable SVDecimal001.
Divides one decimal number by another decimal number.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
arg1 |
Decimal |
The numerator. |
arg2 |
Decimal |
The denominator. |
Returns
Returns the result as a decimal.
Example
This example divides 3 by 4 and returns 0.75 into the decimal variable SVDecimal001.
Divides one integer by another integer, and returns the answer as a decimal.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
arg1 |
Number |
The numerator. |
arg2 |
Number |
The denominator. |
Returns
Returns a decimal value.
Example
This example divides 10by 3 and writes the result to the decimal variable ResultDec.
ResultDec is set to 3.33:
Divides one integer by another integer, and returns the answer as a whole number (truncating any digits after the decimal point).
Parameters
Parameter |
Input Type |
Description |
---|---|---|
arg1 |
Number |
The numerator. |
arg2 |
Number |
The denominator. |
Returns
Returns a number (truncating any digits after the decimal point).
Example
This example divides 10by 3 and writes the result to the number variable ResultNum.
ResultNum is set to 3:
Return the closest integer that is equal to or smaller than the specified decimal. For example, the Floor of 1.7 is 1.0. The output is returned as a decimal value.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
decimal |
Decimal |
The decimal value to find a floor of. |
Returns
Returns a decimal value.
Example
This workflow calculates the floor of the decimal variable decValue which has been set to 5.6, and stores it in the decimal variable floor_decValue.
When executed, floor_decValue is set to 5.0.
Calculates the largest number from a list of decimals.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimals. |
Returns
Returns a decimal.
Example
This example returns the largest decimal number from the LVDecimal001, into the decimal variable SVDecimal001.
Calculates the largest number from a list of integers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of integers. |
Returns
Returns a number.
Example
This example returns the largest number from the list of integer values in LVNumber001, into the number variable SVNumber001.
Calculates the median of a list of decimal values.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimal numbers. |
Returns
Returns the median as a decimal value.
Example
This example returns the median value of the list of decimal values LVDecimal001, into the decimal variable SVDecimal001.
Calculates the minimum value from a list of decimals.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimal numbers. |
Returns
Returns a decimal value.
Example
This example returns the smallest decimal value from the list of decimals LVDecimal001, into the decimal variable SVDecimal001.
Calculates the minimum number from a list of integers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of integers. |
Returns
Returns a number.
Example
This example returns the smallest number from the list of integers LVNumber001, into the number variable SVNumber001.
Performs mathematical multiplication of decimal numbers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimals to multiply. |
Returns
Returns a decimal value.
Example
This example returns the multiplied value of the Decimals in LVDecimal001, into the decimal variable SVDecimal001.
Performs mathematical multiplication of integers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of numbers to multiply. |
Returns
Returns a number.
Example
This example returns the multiplied value of the numbers in LVNumber001, into the number variable SVNumber001.
Raises a base decimal number to the power of an exponent.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
baseNum |
Decimal |
The base decimal number. |
exponent |
Decimal |
The exponent. |
Returns
Returns a decimal.
Example
This example raises 2 to the power of 4 and returns 16.0000 into the decimal variable SVDecimal001.
Returns a randomly-generated integer, from 0 to the specified maximum number.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
max |
Number |
The maximum value for the random number. |
Returns
Returns a random number.
Example
This example returns a random number smaller than 100, into the number variable SVNumber001.
Calculates the remainder when dividing one number by another.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
number |
Number |
The numerator. |
divisor |
Number |
The denominator. |
Returns
Returns a number.
Example
This example divides 9 by 4, returning a remainder of 1 into the number variable SVNumber001.
Rounds a decimal number to the specified precision.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
Decimal value |
Decimal |
The decimal number to round. |
Number of digits |
Number |
The rounding precision. |
Returns
Returns a decimal rounded to the specified precision.
Example
This example rounds a number 3.1415 to a precision of 2, returning 3.1400, and returns it into the decimal variable SVDecimal001.
Calculates the sin of a decimal value representing dgrees.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
degrees |
Decimal |
The angle in degrees. |
Returns
Returns the result as a decimal.
Example
This example calculates the sin of 30 degrees and returns 0.5000 into the decimal variable SVDecimal001.
Calculates the square root of a decimal number.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numToSquare |
Decimal |
The number to find the square-root of. |
Returns
Returns a decimal.
Example
This example calculates the square root of 25 and returns 5.0000 into the decimal variable SVDecimal001.
Calculates the standard deviation of a list of decimal values.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimal values. |
Returns
Returns the result as a decimal.
Example
This example returns the standard deviation of the list of decimals LVDecimal001, into the decimal variable SVDecimal001.
Performs mathematical subtraction of two decimal numbers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
arg1 |
Decimal |
The number to subtract. |
arg2 |
Decimal |
The number to subtract from. |
Returns
Returns a decimal number.
Example
This example subtracts 12.5 from 5 and returns -7.5 into the decimal variable SVDecimal001.
Performs mathematical subtraction of two whole Numbers.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
arg1 |
Number |
The number to subtract. |
arg2 |
Number |
The number to subtract from. |
Returns
Returns a number.
Example
This example subtracts 2 from 5 and returns 3 into the number variable SVNumber001.
Performs mathematical addition of decimal numbers contained in a list.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of decimal numbers to be added. |
Returns
Returns a decimal value.
Example
This example returns the sum of the decimals in LVDecimal001, into the decimal variable SVDecimal001.
Performs mathematical addition of integers contained in a list.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
numbers |
List |
The list of numbers to add. |
Returns
Returns a number.
Example
This example returns the sum of the numbers in LVNumber001, into the number variable SVNumber001.