All Collections
Wrk Action Library
Calculate
Calculate mathematical expression
Calculate mathematical expression
Wrk Product avatar
Written by Wrk Product
Updated over a week ago

Performs a calculation using operators, such as multiplication (*), division (/), subtraction (-), addition (+), etc. Full list of supported operators is found below.

Please note that the expression would be solved in order of operations (i.e. BEDMAS or PEMDAS).

Common use cases

  • Data manipulation

Category

  • Calculate

Inputs (what you have)

NAME

DESCRIPTION

TYPE

REQUIRED

EXAMPLE

Expression to solve

The expression to be solved. Expression does not support algebraic characters.

See full list of supported operators in the section below.

Text

Yes

2*(4+6)

Note: the value of inputs can either be a set value in the configuration of the Wrk Action within the Wrkflow, or a variable from the Data library section. These variables in the Data library section are the outputs of previous Wrk Actions in the Wrkflow.

Outputs (what you get)

NAME

DESCRIPTION

TYPE

REQUIRED

EXAMPLE

Expression result

The value of the expression

Number

Yes

20.8

Outcomes

NAME

DESCRIPTION

Success

This status is selected when the expression was successfully solved.

Unsuccessful

This status is selected in the event of the following scenarios:

- Expression to solve contains operators other than *, /, -, + ,**, //, and %

- Expression contains letters

- Expression starts with an operator other than subtraction (-)

Supported Operators

* multiplication

/ division

- subtraction

+ addition

** power of exponent, e.g. 5**2=25

// integer division, also known as "floor division" , e.g. 5//2=2

% modulus division, e.g. 5%2=1

Note: A value that appears as None should be considered as zero(0)

Examples

For expressions like 5 + 2 , the result is 7.

For expressions like 2 ** 8 - 20*8/3 the result is 202.67.

For expressions like 2 * (4 + 3) result is 14.

Requirements

  • N/A

Did this answer your question?