How to avoid a NAN - Not a Number response

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: How to avoid a NAN - Not a Number response

Post by dazza the stag » Sun Jun 01, 2014 10:31 pm

HH

I think I might have just twigged what you were asking me to do. Effectively the only time the NAN response was given was when the interest rate box was left empty. As you pointed out some of the other boxes either had no effect or gave a "0" response anyway

Therefore I have added the line of code

if Field "MortgageRate1Input" = "" then Field "Mortgage1Result" = "0"

I think that then means that the annuity command can at least perform a calculation even though the result of that calculation isn't a proper one and then may Klaus' instruction about the Try command is completing the loop.

It seems to work but I will keep testing in various formats - thank you all

Post Reply