Forum Discussion
rikapple
11 years agoCommunity Member
Results Slide Percent no Decimal Points
All,
I have a results slide which pulls in data from several other results slide.
The problem is that the results percentage is showing the percentage with decimal points. From a cosmetic po...
TonyChilvers
Community Member
I found this thread while looking for a solution to the same problem.
What I did:
1. Insert a numerical variable called myScore
2. Insert a trigger on the results slide adjusting myScore to the value of the Results.ScorePercent.
3. Insert a new trigger to Execute JavaScript when the timeline starts
4. Click on the … button, and insert the code below into the panel that opens
var player = GetPlayer();
var score = player.GetVar("myScore");
player.SetVar("myScore", Math.round(score));
5. Now edit your Results slide text to display %myScore% instead of %Results.ScorePercent% as below.
Job done :)
Tony C
MikeDelaney
9 years agoCommunity Member
Hey Tony, pretty elegant solution, thanks!
Mike