Forum Discussion
Multiply 4 numeric values
- 2 months ago
It's true that you can only perform one math calculation per trigger. That means you'll need multiple triggers to multiply 4 numbers.
For example.
- Use NV1, NV2, NV3, and NV4 as the variable names for the 4 values to be multiplied.
- Also create a numeric variable (e.g., NV_calc) for the calculated amount.
- Trigger 1: Set NV_calc to the value of NV1
- Trigger 2: Multiple NV_calc by the value of NV2
- Trigger 3: Multiple NV_calc by the value of NV3
- Trigger 4: Multiple NV_calc by the value of NV4
The NV_calc variable will update with each trigger.
Note: Access the operators by clicking that part of the trigger wizard.
Thank you so much, Judy. This was very helpful! I didn't realize that the NV_calc could store all the entries, and that's what I was having the biggest trouble with.
Happy sidenote, I like that it doesn't recalculate if I click the Calculate button again. I have to re-enter values in each field re-activate the Calculate button, which is exactly what I needed. (Adding in case someone else ends up in the same place as me.)
I watched some tutorials and my head started to spin when I saw directions for Javascript 😵 Would love to get there eventually! This was a simple and effective solution, and your help is very much appreciated.
- JudyNollet2 months agoSuper Hero
I'm glad you've got your slide working they way you want it to.
For future reference (for you or anyone else who finds this thread): Here are some common mistakes:
- Not properly resetting a variable. (For example, using only triggers that perform a math operation, but without starting with a trigger that sets the "total" variable to the appropriate starting number.)
- Not controlling when/how often the math operation is performed. (For example I've seen files where the total variable becomes higher than expected because the user re-clicks a button and a number is added every time they do that.)
Bottom line: It's good to show the variable references on the slide. That let's you watch what happens as you interact with the slide, which helps with troubleshooting. If the user doesn't need to see the references, just move the text box with the references off the slide, hide it, or delete it before publishing.
Best wishes for success with your projects!