Class FlowableExpressionMathUtils
java.lang.Object
com.flowable.platform.expressions.FlowableExpressionMathUtils
Expression Bean Name: flw.math
Provides a number of mathematical operations.
Please note that all operations will return a number of type @{link Double}.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
abs
(double number) Returns the absolute value of a number.double
average
(Collection<Double> numbers) Calculates the averages of a list of numbers.double
ceil
(double number) Returns the next higher integer of a provided number.double
floor
(double number) Returns the next lower integer of a provided number.double
max
(Collection<Double> numbers) Returns the highest number from a list of numbers.double
median
(Collection<Double> numbers) Returns the median of a list of numbers.double
min
(Collection<Double> numbers) Returns the lowest number from a list of numbers.double
parseDouble
(String string) Convert a string to a double valueint
Convert a string to a double valuedouble
round
(double number) Rounds a number,double
round
(double number, int scale) Round a number to a maximum of decimal places usingRoundingMode.HALF_UP
double
sum
(Collection<Double> numbers) Sums up a list of numbers.
-
Constructor Details
-
FlowableExpressionMathUtils
public FlowableExpressionMathUtils()
-
-
Method Details
-
sum
Sums up a list of numbers.- Parameters:
numbers
- The numbers to be summed- Returns:
- The sum
-
average
Calculates the averages of a list of numbers.- Parameters:
numbers
- The numbers to calculate the average of- Returns:
- The average of the numbers
-
floor
public double floor(double number) Returns the next lower integer of a provided number.- Parameters:
number
- The number to be rounded- Returns:
- The rounded down number
-
ceil
public double ceil(double number) Returns the next higher integer of a provided number.- Parameters:
number
- The number to be rounded- Returns:
- The rounded up number
-
round
public double round(double number) Rounds a number,- Parameters:
number
- The number to be rounded- Returns:
- The next higher or lower number depending on the value of the provided number.
-
round
public double round(double number, int scale) Round a number to a maximum of decimal places usingRoundingMode.HALF_UP
- Parameters:
number
- The number to roundscale
- The number of decimal places to return- Returns:
- The rounded number
-
min
Returns the lowest number from a list of numbers.- Parameters:
numbers
- The numbers to find the lowest number of- Returns:
- The lowest number
-
max
Returns the highest number from a list of numbers.- Parameters:
numbers
- The numbers to find the highest number of- Returns:
- The highest number
-
abs
public double abs(double number) Returns the absolute value of a number.- Parameters:
number
- Number of find the absolute value of- Returns:
- The absolute value
-
median
Returns the median of a list of numbers.- Parameters:
numbers
- The numbers to find the median of- Returns:
- The median value
-
parseDouble
Convert a string to a double value- Parameters:
string
- The string value- Returns:
- A double value
-
parseInt
Convert a string to a double value- Parameters:
string
- The string value- Returns:
- An int value
-