Number Variables Error: NaN
Oct 31, 2023
Hello Heroes,
I'm working on a Storyline project that requires me to complete some math in Javascript. This requires very small numbers (decimals near 0.0004) and because Storyline rounds number variables to two decimal points, i'm trying to use Javascript. Ultimately, I am trying to calculate the monthly payment on a home.
In the attached example, the set variables are pulled into JS with the second button and 2 instances of JS math are performed.
You'll see the code is able to calculate the Principal, but the calculation for Monthly Payment always returns NaN.
I've tested this code in a javascript playground and all of the math checks out. What are some reasons I am returning NaN?
2 Replies
the problem ist line 4
replace "RLP_Rate" with "RLP_InterestRate"
result:
https://360.articulate.com/review/content/ef34debb-95a4-4194-bd9e-4f0567fc3965/review
Thank you so much Jürgen!!! I'm still newer to Javascript, so my initial thought was this had to be a Storyline limitation. Great news that this isn't!