Forum Academy Marketplace Showcase Pricing Features

New Plugin: Easily Calculate Math Expressions

Hi everyone!

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.

Plugin Page: Complex Math Expression Calculator Plugin | Bubble
Editor: Blur-apps-playground | Bubble Editor

HOW TO USE IT:

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

  2. 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.

  3. 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.

Hope this helps!

3 Likes

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.

Try formulize - I think it’s a paid one though

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!

1 Like

Trying to get this formula to work (works in Excel):

=ROUND(((C22-40)/20((C9^0.425)*(C10^0.725)71.84/10000)0.739/C9-0.003)^0.50.7,4)

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.

I should have mentioned:

  1. The result I am getting is the “number” -1 (minus one)
  2. The formula as it stands above produces a percentage result in the Excel sheet.
  3. 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.