Multiply (*) and Divide (/) Buttons

In the following example, we will calculate two values using the multiply (*) and divide (/) buttons.

Create a new calculator and add four number inputs with property names input1, input2, input3, and input4. Add two outputs with property names multiply_answer and divide_answer.

Next, click on the Script Helper and place your text cursor between {} on line 4 in the script editor.

Click on the value multiply_answer button, which will be the output for multiplication. Then select number input1, multiply (*), and number input2 buttons and click Done.

In the script editor, on a new line (line 5), repeat the above steps for division using value divide_answer, divide (/), input3, and input4 buttons.

When selecting the buttons, your Script Helper box should look like this:

Click Done and your script editor should have the following codes:

'use strict'; return { multiply_answer: inputs.input1*inputs.input2, divide_answer: inputs.input3/inputs.input4, };

Your IO tab should look like this:

The same steps can be used for the plus (+) and minus (-) buttons. You can have more input/output in a calculator depending on how you create it. Just remember to select the correct buttons.

Did this answer your question?