Getting variable and rounding up with Java script

May 20, 2021

Trying to take a variable and rounding it up to the nearest thousand. Can someone help with the code.

player.GetVar("Life7074");
var Num = "Life7074;
var val = Math.ceil( num / 1000) * 1000);
player.SetVar("Life7074",val);

5 Replies
Russell Killips

I’m not at work today. But from taking a quick look, I see that ldt is all lowercase in line 2 and LDT is capitalized in the last line.

Javascript is case sensitive. Make sure the variable name matches how you have it declared in your storyline variables.