Skip to main content
A_Gussenberg
Jul 13, 2023 8:38 AM UTC

Calculation formula within variable input

Hey folks, first of all I love the new variable function. Within the setup of spacings I want to reference my base value (“8”) and do calculations, e.g. (spacing-base)*2". This works fine and the value is calculated properly within the input to add a new variable. But I expected not that the calculation string changes to the absolute value. With this behaviour I loose the connection/ reference to my base value and the calculation is some how obsolete.

Does anybody feel the same?
Will there be an update?

image

Thanks

75 replies

Daniel_Myrenne
Sep 5, 2023 11:03 AM UTC

I would appretiate this feature as well!
Scaling items depending on values is one thing I’m working most of the times.

Nomad_Bakr
Sep 21, 2023 11:28 PM UTC

Yeah, It would be great to add calc() function to variables definitions similar to CSS including numbers, colors, and booleans

Sep 29, 2023 7:55 AM UTC

It will be great to be able to create REM.

Josh_Mitchell
Nov 8, 2023 11:39 AM UTC

My eCommerce prototype contains 3 prices that change based on the user’s choices: monthly price, total price and RRP. Each of these prices is set to a variable, which updates based on the interaction.

Currently to update the 3 prices each choice has to trigger 3 conditions (e.g. if user chooses option A then ‘Total price’=100, ‘Monthly price’=‘Total price’ ÷ 12 and ‘RRP’=‘Total price’ + 10.

It would save a lot of time if I could set these relations in the variables values themselves (e.g. ‘Monthly price’=Total price ÷ 12 and ‘RRP’=‘Total price’ + 10). This would mean that each choice would only need to update the ‘Total price’ and the ‘Monthly price’ and ‘RRP’ would update automatically.

Johan_Wastring
Nov 30, 2023 8:46 AM UTC

I am looking forward to this as well. It would be super handy and save a lot of time when rescaling things if you could use the variables on things like corner radii.

Jared_Rice
Dec 1, 2023 4:59 PM UTC

+1 being able to multiply spacing values by a base variable would save a lot of manual effort

Dave_Tanner
Jan 15, 2024 1:48 AM UTC

+1 for this. Need this for things like base values and REM, and would also be handy for proportional resizing.

Flowmedia
Jan 23, 2024 12:59 PM UTC

+1
I would like to change radius, and inner radiuses based on a single number. (Mainradius-2)

Jan 23, 2024 8:55 PM UTC

+1 Would love this feature as well!

Jenni_Merrifield
New Member
Jan 26, 2024 8:06 PM UTC

+1 from me for defining one variable as the result of a calculation of one or more other variables.

I would also like the ability to apply calculations anywhere a variable can be assigned. Essentially, the flip side to assigning calculations to variable definitions is that instead of requiring multiple variables, one for each calculation, you could have a few base variables and then specify any calculation using them where you need to.

For example, if you have two layers, X & Y, which need to have opposite visibility (i.e. if one is shown/hidden, the other is hidden/shown) I could create Boolean “x-is-visible”, and then apply “x-is-visible” to X and “not x-is-visible” to Y. Otherwise you’d need two variables to accomplish the same thing.