How to get % of a Number?

Hi,

how can i get the % of a number? ex. Amount minus 10% = Results minus 8% = Results?

so if we translate it to numbers ex. 1,000 - 10% = 900 - 8% = 828 <-- Final Result

1 Like

There are many ways to do this, but the general form of an expression like that is:

Number * (100 - first percent) * (100 - second percent), etc.

So in your specific example:

Result = Number * 0.9 * 0.92

Note that an input styled as percent SHOWS its value like “10%” and its value field returns 0.1.

@keith

is possible to add parenthesis when doing a calculation? because i didn’t see any parenthesis

7

so if we translate it to numbers ex. 1,000 - 10% = 900 - 8% = 828 <-- Final Result

My personal preference is to use the Expression element from the Toolbox plug-in when doing calculations. It adds the ability to use parentheses and much more. Also allows you to separate the calculation from the formatting of the result. The Expression will result in a number, and then you point a text element, to the Expression’s value. Order of operations in core bubble is left to right, with no support for parentheses.

How can i do that if the number i want to calculate is inside a Repeating Group? ex. Current cell’s Amount - 10%

Then the Expression element would be placed within the repeating group and you then reference the current cell.

Nope, a sadly lacking feature of Bubble is fine-grained control of “order of evaluation” in expressions. It would be nice, right? (There are no parens unfortunately.)

What you can do is hold your intermediate values in custom states and do your computations in multiple workflow steps. (At least, that’s one way.)

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