I’ve noticed how math calculations can be a little challenging in Bubble - even if it is a simple ordered calculation that makes use of brackets. This plugin is for those who’d like a simple way to implement math that can’t be evaluated directly in Bubble.

In the Editor, find the ‘Math Calculator’ element in your Visual Elements and add it to your Bubble App

In the properties of this element, assign the input Expression by building a text in the form of a mathematical expression.
This expression can include operators like +, -, /, *, ( ) brackets and more.
It will also accept boolean expression operators like ||, &&, ^, ! and more.
The expression can also include data from dynamic sources. For example, 1+(Do a Search for Users:count *3) is a valid expression and will take the value of the Bubble dynamic data and calculate with it.

Now you can make use of the results of this calculation in an element for displaying or calculations.
For example, WHEN MathCalculator A's Number Result > 3 is a valid expression for any element’s conditional properties.
And 3*MathCalculator A's Number Result is a valid expression for displaying visual elements like Text, Buttons, etc.

Some good use cases are checkout pages, repeating groups displaying complex dynamic values, etc.

This plugin is nice, but I can’t use it for backend workflows. I wish someone would build a plugin for server-side math expressions that doesn’t rely on an external API.

Alternatively if you go to settings on your app, you can opt in for one of the new experimental features that lets you do some of this on your dynamic text editor!

The cell references have been replaced by the unput fields.
Do I have the syntax right? (not getting the correct answer).
What does it do?
It is a body fat calculator that takes 10 body fat site measurements, adds them all up (C22) and then performs this calculation.
The Bubble workflow take all the values, sums the 10 values and then performs this calculation.
Any help much appreciated.

The result I am getting is the “number” -1 (minus one)

The formula as it stands above produces a percentage result in the Excel sheet.

I’m not sure how to handle the fact that without a percentage field the formula would produce a fraction result e.g. - 0.1648. I’ve tried multiplying by 100 in the calculator and then also in the workflow.

I have a lot of calculs to do and each one is dependent of the precedent result.

Is it better to do one WF Action with:

Step 1 Calcul 1
Step 2 Xstep1 result
Step 3 YXstep2 result

Or

Calcul 1
Then use the action When math calculator Step 1 is done calculating
Calcul 2
Then use the action When math calculator Step 2 is done calculating
Calcul 3

I am wondering if the second version is safer or unnecessary ?

Option 2 would be more reliable.
You want to avoid cases where the the next step starts before the previous one finishes - this may happen on async operations on Bubble - especially when the next step can’t reference the previous step’s result.

The plugin is good for frontend operations, but not suitable for backend workflows. You can try formulize or an experimental feature in bubble settings for server-side math expressions. For the body fat calculator issue, the formula syntax might not be correct. Use option 2 as it ensures each step finishes before the next one starts. Overall, the plugin is useful for scenarios like checkout pages and displaying dynamic values.