Mathematical

This content applies to legacy design tools (such as K2 Studio, K2 for Visual Studio, or the Silverlight-based K2 workflow design tool). If you have upgraded from K2 blackpearl 4.7 to K2 Five, these tools may still be available in your environment. These legacy tools may not be available in new installations of K2 Five. These legacy tools may also not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component support policy for more information about support for these components.

Mathematical functions perform calculations, usually based on input values, and returns a number.

An item is selected and then added to the canvas or K2 field part by clicking the Add button or by dragging it to the right place.

Functions Description Example
Absolute - Decimal Gets the absolute (positive) value of a number. Input Value: -1.1
Result: 1.1
Absolute - Long Gets the absolute value of a number. Input Value: -2
Result: 2
Average - List of Decimal Calculates the average of a collection of values. Input Values: { 1.1, 2.2, 3.3 }
Result: 2.2
Average - List of Long Calculates the average of a collection of values. Input Values: { 1, 2, 3 }
Result: 2
Format Number - Decimal String Formats a number to a text representation using a specified numeric format specified. Number: 0.111
Format: "C"
Result: "$ 0.11"
Maximum - List of Decimal Gets the maximum value of a list of values. Values: { 1.1, 2.2, 3.3 }
Expected When Empty:
0
Result: 3.3
Maximum - List of Long Gets the maximum value of a list of values. Values: { 1, 2, 3 }
Expected When Empty: 0
Result: 3
Minimum - List of Decimal Gets the minimum value of a set of values. Values: { 1.1, 2.2, 3.3 }
Expected When Empty: 0
Result: 1.1
Minimum - List of Long Gets the minimum value of a set of values. Values: { 1, 2, 3 }
Expected When Empty: 0
Result: 1
Power - Decimal Gets one value raised to the power of another. Base: 1.1
Power: 1.1
Result: 1.11053424105458
Power - Long Gets one value raised to the power of another. Base: 2
Power: 2
Result: 4
Random - Decimal Gets a random number less than or equal to a specified maximum value. Maximum: 1.2
Result: 0.5810660167974728
Random - Long Gets a random number less than or equal to a specified maximum value. Maximum: 2
Result: 1
Random Between - Decimal Gets a random number between two specified values. Minimum: 0.0
Maximum: 1.2
Result: 0.5810660167974728
Random Between - Long Gets a random number between two specified values. Minimum: 0
Maximum: 2
Result: 1
Root - Decimal Gets the positive nth root of a positive number. Number: 32.0
Nth Root: 5.0
Result: 2.0
Root - Long Gets the positive nth root of a positive number. Number: 100
Nth Root: 2
Result: 10
Round - Decimal Rounds a number up or down to a value with a specified precision. Value: 1.111
Digits: 1
Result: 1.1
Round Down - Decimal Rounds a value down. Value: 1.15
Digits: 1
Result: 1.1
Round Up - Decimal Rounds a value up. Value: 1.15
Digits: 1
Result: 1.2
Square - Long Gets the square of a number. Number: 2
Result: 4
Square - Decimal Gets the square of a number. Number: 1.1
Result: 1.21
Square Root - Decimal Gets the square root of a number. Number: 1.1
Result: 1.04880884817015
Square Root - Long Gets the square root of a number. Number: 100
Result: 10
Sum - List of Decimal Gets the sum of a set of values. Values: { 1.1, 2.2, 3.3 }
Result: 6.6
Sum - List of Long Gets the sum of a set of values. Values: { 1, 2, 3 }
Result: 6

The Function wizard content varies according to the function: