Forum Discussion
A Solution to rounding in Storyline – without using Javascript
A colleague shared this very helpful tip that finally solved the issue for me! I created a Storyline number variable called RoundedScore, which I set equal to the Results.ScorePercent as the results slide timeline begins. Then I execute this Javascript:
var player = GetPlayer();
var score = player.GetVar("RoundedScore");
player.SetVar("RoundedScore", Math.round(score));
Finally, I changed the "%Results'ScorePercent%%" text on the results slide to "%RoundedScore%%", and it works in Storyline 3! I hope this helps others who want to round the percentage in Storyline 3.
- SimonC8 years agoCommunity Member
Hey Mike, I tried your method in Storyline 3 and it didn't seem to work for me. Do you execute that Javascript when the timeline starts are is the trigger set up to go off at some other point?