Forum Discussion
Javascript Math.pow
As said... now you can see the full glory of all decimals... but the lower field is a textString, so make sure when doing calculations with it to convert it back to a Number.
https://360.articulate.com/review/content/d714fde1-7952-4530-8993-afc2c23e1b55/review
Code now is like this:// connect with Storyline Player
let player = GetPlayer();
//Get the variables NetFig and NetPower
let nFig = player.GetVar("NetFig");
let nPow = player.GetVar("NetPower");
// Do the calculation and set a variable to it
let endRst = Math.pow(nFig, nPow);
//convert this to a string
let tmpString = endRst.toString();
// And set a Storyline String as endResult so you get more then 2 decimals
player.SetVar("EndResultStr",tmpString);
// Set the Storyline variable to it, so it shows in Storyline
player.SetVar("EndResult",endRst);