Support for basic math calculations

11 months ago by Simon Choy

You can now apply basic math operations on numbers or variables without using Javascript snippets! There is a new syntax to support the math operations, e.g. {{1 + 1}}. mabl will attempt to evaluate the contents within {​{ ... }} as a math expression and return the numerical result. If you want to perform the mathematical operations on a variable, you can use the syntax {​{@​variable + 1}}. If you want to use multiple variables in the calculation, you can! Simply type in the expression within the {​{ ... }}, e.g. {​{@variable1 + @variable2}}.

Using the variable creation form, under the "String template" option, you can create a new variable by computing the result from the math expression. You can also update the value of a variable by overwriting the previous value with the new value in this form.

The current operations supported are addition (+), subtraction (-), multiplication (*), and division (/). For for information, please see the help docs.

Valid patterns and expressions

Hovering over the question mark icon next to "Pattern" will show a tooltip that contains a short list of examples of various supported patterns and expressions. Clicking on the Learn more link will bring you to the help docs with more detailed explanations.