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
...
ChrisElkin
Community Member
Hi - thanks for this script.
I've added the additional line to the code:
var numTimes = numValue * 0.3;
and now I don't get a rounded whole number with every calculation
e.g.
enter 100 returns 30 - cool
enter 30 returns 9 - cool
enter 54 returns 16.2 - ??? would like it to round unto 17
NE1?
_________________________________________________________________________
var numValue = player.GetVar("howMany");
var numTimes = numValue * 0.3;
var JSRoundedNum = numTimes.toFixed(1);
player.SetVar("total",JSRoundedNum);
PhilMayor
10 years agoSuper Hero
Shouldn't it be .toFixed(2) for 2 decimal places
Sent from my iPhone