Forum Discussion
AdrianaViveros
4 years agoCommunity Member
Number Variables Error: NaN
Hi Everyone,
I'm working with number variables to create a budget calculator. Where the multiple sources of income (variables) are added when the learn taps calculate. It was working perfectly and...
WaltHamilton
3 years agoSuper Hero
You have the same problem as Adriana. When you put a default value of 0 in a variable, don't change it, and attempt to perform a calculation with it, SL regards it as a text character, and the result is NaN.
Also, if the learner clicks the Score button halfway through, then again later, it will show twice the actual score. To solve both of those problems, create a trigger to set TOTAL to 0 when user clicks BUTTON_SCORE. then move it to the top of the list of triggers for clicking on BUTTON_SCORE.