Math formula help - Forum

Forum Navigation
You need to log in to create posts and topics.

Math formula help

I made the following math commands that sums 5 results and calculates the score % at the end

I get an error message in the last line saying that this command required 3 parameters

I failed to find the correct syntax

Any help please

SetVar [tot] 0
Loop 1 5 [counter]
SetVar [tot22] [Q1(counter)]
Math "[tot]"+"[tot22]" [tot]
EndLoop
Math "[tot] *100 / 5" [Score]

@hatemtag

The Help file page for the Math command here ... https://webhelp.visualneo.com/Mathematical.html ... is erroneous ... as with the same command in VisualNEOWin, you need to specify in the second parameter, the number of decimal points to be shown after doing the calculation (in the first parameter) ... try ...

Math "[tot] *100 / 5" 2 [Score]

... for 2 decimal places.

 

BTW, your Math command inside the Loop/EnLoop code block ...

Math "[tot]"+"[tot22]" [tot]

... also appears to be incorrect ... assuming the totals have 0 decimal places, perhaps you need ...

Math "[tot]+[tot22]" 0 [tot]

Sorry @hatemtag, it's true, there is an error in the help file.
Will correct it as soon as possible.
When in doubt just double click the command name in your code to show up the action wizard window. It will display all the necessary parameters (see attached image).

Regards.

Uploaded files:
  • You need to login to have access to uploads.