Variable output showing a neagtive figure - how to invert?

Hi all

I have a little game set up in a course in Storyline 2, which shows a % return of a series of selected stocks (variable called 'return'). However, on choosing losing stocks the variable becomes negative, so when used as a reference in a later text box as "you lost %return%%" it shows as "you lost -37%" (as an example).

How do I remove the leading '-'? This is dragged through from the variable reference so what I really need to do is find a way to turn a negative result to a positive.

Any help would be appreciated.

4 Replies
Wilf Moralee

Thanks to you both for that. The -1 is what I was looking for but needed to but an extra rule is as the result could also show a positive, and did not want that converting to a negative. I therefore added a trigger when the 'go' button was clicked to multiply the variable by -1 if the variable was lower than '0'. This works perfectly.


Thanks for your help.