Hi, i need help how do i solve these 4 variable (calculator)

Hello, I would like to ask about a question I have before but now there are 4 variables and it will be like the first second and the third variable is next to each other there will be no sign in between the 3 variales and those three variable will be multiplied to the fourth variable

For Example:
155*10 = 1550

1 = first variable
5 = second variable
5 = third variable
10 = fourth variable
1550 = result

I did try this but I can’t do it like this
VariableString(_firstNumber) + VariableString(_secondNumber) + VariableString(_thirdNumber)*VariableString(_fourthNumber)
there is an error happening when I did try to do it like this so I tried
this
VariableString(_firstNumber) + VariableString(_secondNumber) + Variable(_thirdNumber)*VariableString(_fourthNumber)

but the result is not the same as I want it to be. Thank you for the answer in advance

You cannot use math equations on strings.

what you should, in theory, be doing is converting it to a number, then multiplying.

So it’d be like ToNumber(VariableString(first)+VariableString(Second)+VariableString(Third))*Variable(forth)

If you’re trying to display the result in a text object, you’d then have to wrap the entire thing above in a SINGLE ToString()

2 Likes

Did you look at what I’d written in your other post, and try to understand it?


To expand on that what @Silver-Streak wrote,


This bit adds string together, or concatenates them :

VariableString(first)+VariableString(Second)+VariableString(Third)


This part converts the concatenated string into a number :

ToNumber(VariableString(first)+VariableString(Second)+VariableString(Third)


And the this final bit multiplies the last number with the result of the parsed concatenated variables :

ToNumber(VariableString(first)+VariableString(Second)+VariableString(Third))*Variable(forth)

2 Likes

As I didn’t see this was a duplicate, I’m closing out this thread. If you have further questions you are welcome to continue them in the original thread.