There may be a requirement to round the results of the quiz so as to display a full number and not a number with a decimal place. For example, show 91% instead of 90.89%.
Click on the 3 dots beside the Script and enter the following code:
var player = GetPlayer(); var tempResults = Math.round(player.GetVar("MyResults")); player.SetVar("MyResults",tempResults);
This code will take the actual value that was put into the MyResults variable and put it in a temporary variable where the rounding will occur. The rounded value is then put back into MyResults variable. Now that the correctly rounded results are in our variable, we can display the contents of the variable on the results page. This is achieved by adding a text box and wrapping the variable in %.