Forum Discussion
KevinMcGrath
2 years agoCommunity Member
javascript not working
Hi,
I'm running the following JavaScript but it doesn't work (variable stays at 0)
Can anyone tell me where I've gone wrong?
let player = GetPlayer(); let num1 = player.GetVar(“Total_Mone...
Jürgen_Schoene_
Community Member
let result = Math.(num1/num2);
"Math." is the problem - it is only the first half of the function name
if you want to round to an integer, the function is Math.round( ... )
KevinMcGrath
2 years agoCommunity Member
Thanks so much! Got it working. It also wasn't recognising things with "..." so I swapped to '...' and swapped let to var and it's working correctly now. So happy. Thank you!