Transformations of calculated values

Hi, is it possible to perform transformations such as rounded to, floor, or ceiling on calculated values? Something like (A value / B value):rounded to 1. I don’t see any option to add the parentheses in Bubble Editor. I’m trying to do this on a repeating group, so I didn’t find a way to work around this by using states. The only solution, which works for me is saving the calculated values to DB and then transforming it, but performance-wise that’s a really bad solution…

Bubble performs calculations in the order they’re written (left to right), so in your above example you just need to use A value/B value: rounded to 1.

The rounding is done on the result of the calculation.

If you need to use parentheses, i think there are some plugins that let you do it, or alternatively, you can save values to custom states (rather than the DB) then use those values in more complex calculations.

Thanks, I must have made some mistake, because this didn’t work for me before:)

I wanted to use custom states, but as this is performed on a repeating group I need a different value for each element in the group, so I’m not sure how to use states for such a use case…

No reason you can’t use custom states in a repeating group. If you set a custom state on an element in an RG, the state will only apply to the element in the given cell, so each cell’s element’s custom state will have it’s own value.

OK, I will try it, thank you.

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