Forum Discussion
TerryMcDonald
12 years agoCommunity Member
A Solution to rounding in Storyline – without using Javascript
Normal
0
false
false
false
oNotPromoteQF />
EN-US
X-NONE
X-NONE
...
YoncaUral1
9 years agoCommunity Member
Hi,
As someone who doesn't really know much about Javascript, I'm trying to figure out how to solve a problem I'm having. In our course, we have a variable that we are displaying on each page to show the % complete. We did the divide by 10,000,000 then multiply by 10,000,000 and it's working fine non-mac devices. However Macs are still displaying the two decimal places and we want to get rid of that. So, I tried to add this JS after my % visited variable is calculated and it's not working.
Here is what I added:
var player = GetPlayer();
var numValue = GblScreensVisitedPercentage
var JSRoundedNum = numValue.toFixed(1);
player.SetVar("RoundedNum",JSRoundedNum);
Any thoughts would be greatly appreciated!