Add an action for arithmetic calculations.

jensschuppe requested to merge (removed):dev_calculate into master

This adds an action for arithmetic operations with pre-defined binary arithmetic operators. Operands can be either defined statically in the action's configuration or parameters, the latter overwriting the former, if both are given.

Supported operators:

  • + (Sum)
  • - (Difference)
  • * (Product)
  • / (Quotient)
  • % (Remainder)
  • ** (Power of) - available since PHP 5.6

This action uses eval() for performing the calculation. For safety, operands are being validated to be numeric; operators are being validated to be in the list of pre-defined operators.

Merge request reports