# Math operations

**URL:** <https://forum.bubble.io/t/math-operations/113986>\
**Category:** Need help\
**Created:** [September 30, 2020, 1:43pm UTC](https://forum.bubble.io/t/math-operations/113986 "2020-09-30T13:43:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 1:43pm UTC](https://forum.bubble.io/t/math-operations/113986/1 "2020-09-30T13:43:59Z")

</div>

Is there any documentation about how to make math operations with Bubble?

I’m trying to make a sub, (10 - Current’s User Current Points)…

How to do it?

Any of the math plugins have documentation, there is no video on Youtube, and any mentions about MATH OPERATIONS on Bubble Manual or the Full Reference… ☹

---

<div class="post-metadata">

**Author:** ![j.hennersdorf](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@j.hennersdorf](https://forum.bubble.io/u/j.hennersdorf)\
**Post date:** [September 30, 2020, 2:00pm UTC](https://forum.bubble.io/t/math-operations/113986/2 "2020-09-30T14:00:26Z")

</div>

My experience is that bubble is bad in mathematical operations. I have given up to let more complex calculations be calculated. Not sure, but I think bubble calculates from left to right. As a result, it does not know dot before dash and no parentheses. (Does not exist anyway)

Solutions were with me. To create a separate group of type number, to let calculate the single operations there and then to let calculate the results again in a new group. and so on…

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [September 30, 2020, 2:17pm UTC](https://forum.bubble.io/t/math-operations/113986/3 "2020-09-30T14:17:45Z")

</div>

I would really recommend the [Toolbox](https://bubble.io/plugin/toolbox-1488796042609x768734193128308700) plugin for this. You’ll find an element called _Expressions_, which gives a lot more freedom in math expressions than Bubble does out of the box.

---

<div class="post-metadata">

**Author:** ![f11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/f11/32/70167_2.png) [@f11](https://forum.bubble.io/u/f11)\
**Post date:** [September 30, 2020, 2:18pm UTC](https://forum.bubble.io/t/math-operations/113986/4 "2020-09-30T14:18:12Z")

</div>

You can do basic math on most Dynamic fields, though very basic ones (ie no parenthesis). Download the Toolbox plugin and add an Expression element to do more complex things.

---

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 2:31pm UTC](https://forum.bubble.io/t/math-operations/113986/5 "2020-09-30T14:31:04Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/c/7/c790bcef8c75bdcf9077d27b7168e4f2ee109383.png)

It doesn’t work… ☹

---

<div class="post-metadata">

**Author:** ![bubbablaise3](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bubbablaise3](https://forum.bubble.io/u/bubbablaise3)\
**Post date:** [September 30, 2020, 2:32pm UTC](https://forum.bubble.io/t/math-operations/113986/6 "2020-09-30T14:32:24Z")

</div>

There is plugin called “instant calculator” built by copilot. I use it to calculate complex arithmetic.

---

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 2:37pm UTC](https://forum.bubble.io/t/math-operations/113986/7 "2020-09-30T14:37:12Z")

</div>

I believe (10 - Current’s User Points) is not a complex arithmetic… 😕

---

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 2:39pm UTC](https://forum.bubble.io/t/math-operations/113986/8 "2020-09-30T14:39:31Z")

</div>

![image](https://us1.discourse-cdn.com/bubble/original/3X/a/c/ac5175ba3327d756582286bb1d5da5d84d1e6327.png)

It doesn’t work…

---

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 2:41pm UTC](https://forum.bubble.io/t/math-operations/113986/9 "2020-09-30T14:41:06Z")

</div>

I can’t believe so hard is to make a simple basic math operation on Bubble… 😮

Is possible to create ERP and CRM apps, but it’s impossible to create a calculator… 🤣

---

<div class="post-metadata">

**Author:** ![shawnmi6](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/shawnmi6/32/96625_2.png) [@shawnmi6](https://forum.bubble.io/u/shawnmi6)\
**Post date:** [September 30, 2020, 2:52pm UTC](https://forum.bubble.io/t/math-operations/113986/10 "2020-09-30T14:52:41Z")

</div>

Assuming the Current’s User Current Points field is a number type and not text you should be able to easily calculate:

“Current’s User Current Points - 10”

You have to use the built in “-“ operator not type it out yourself. Anytime you use the “more” tool which is connected to a number and not a text value then you should see a list of all the basic math operators.

---

<div class="post-metadata">

**Author:** ![eliaspatrickjunior](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eliaspatrickjunior/32/71928_2.png) [@eliaspatrickjunior](https://forum.bubble.io/u/eliaspatrickjunior)\
**Post date:** [September 30, 2020, 2:59pm UTC](https://forum.bubble.io/t/math-operations/113986/11 "2020-09-30T14:59:37Z")

</div>

Almost there!

I could calculate “Current’s User Current Points - 10”.

But, on my app, Current’s User Current Points is always less or equal 10, that’s why I need to calculate “10 - Current’s User Current Points”.

Any suggestion?

Regards!

---

<div class="post-metadata">

**Author:** ![shawnmi6](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/shawnmi6/32/96625_2.png) [@shawnmi6](https://forum.bubble.io/u/shawnmi6)\
**Post date:** [September 30, 2020, 3:02pm UTC](https://forum.bubble.io/t/math-operations/113986/12 "2020-09-30T15:02:25Z")

</div>

Set a state anywhere on the page and define the type to number and set the default value to 10 and use that in the expression.

State’s value:more select “-“ Current’s User Current Points

---

<div class="post-metadata">

**Author:** ![f11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/f11/32/70167_2.png) [@f11](https://forum.bubble.io/u/f11)\
**Post date:** [September 30, 2020, 3:03pm UTC](https://forum.bubble.io/t/math-operations/113986/13 "2020-09-30T15:03:24Z")

</div>

You can’t combine text with a dynamic expression. All math needs to happen within the Dynamic expression.

---

<div class="post-metadata">

**Author:** ![petter](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/petter/32/98626_2.png) [@petter](https://forum.bubble.io/u/petter)\
**Post date:** [September 30, 2020, 5:35pm UTC](https://forum.bubble.io/t/math-operations/113986/14 "2020-09-30T17:35:23Z")

</div>

> [@eliaspatrickjunior](#):
>
> I can’t believe so hard is to make a simple basic math operation on Bubble… 😮
> 
> Is possible to create ERP and CRM apps, but it’s impossible to create a calculator… 🤣

I’ll have to agree this part is kind of weird 😅

> [@eliaspatrickjunior](#):
>
> ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/7/c790bcef8c75bdcf9077d27b7168e4f2ee109383.png)
> 
> It doesn’t work…

This should be working. Are you sure that you’ve set the Expressions’s Result type to **number**?

Are you seeing any debugger errors?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 9, 2020, 1:43pm UTC](https://forum.bubble.io/t/math-operations/113986/15 "2020-12-09T13:43:59Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
