Forum Academy Marketplace Showcase Pricing Features

Adding values of text elements together

Hi guys,

I’m building a simple calculator and I’m trying to sum some values together. In the attached screenshot, i’m trying to add A and B together and place in C, and add X and Y together and place in Z.

How should I go about this? The values of A, X, B and Y have multiple sets of conditional calculations that can’t be combined in a single box in C or Z.

Any help would be greatly appreciated!

If you are doing math operations, the field value types would need to be numbers not texts.

Thanks Johnny… There’s no other element that i can use where I can do conditional math calculations and output the result… The only visual element that i can use to achieve this is the “Text” element, unless I’m missing something? I checked all the settings of the Text element to see if I can set the value type, but I can’t.

What are the other options instead of using a text element? How would you approach this scenario?

I’m talking about the field that the numbers are stored as. Not the visual element.

They aren’t stored in the database.

Are they stored in states?

Nope. The values are produced by the calculations in the below screenshot (this example is based on the selected element in the screenshot i.e. box “A” in the screenshot from my first comment on this thread):

I’m using a plugin called instant calculator to do some calculations based on the slider values, and then i’m using the conditional logic and some additional math (as shown in the screenshot) produce the output.

Any solution for that issue? I need this too :no_mouth:

In case somebody comes back looking for a solution for this:

Instead of using textboxes for display I used inputs elements. I stripped down the formatting to look like a textbox, which for display purposes cannot be differentiated. Then I made the input element non-editable, making it functionally indistinguishable as well.

The input element’s values allow having specified types, so I was able to leave the display values as number types, which let me do calculations between them.

I have no idea if this has performance implications, but it works! Hope this helps.