Simple QML Math Problem

Hi all,
I'm practicing building apps for BB10 using the Cascades framework, recently I ran into a problem when trying to do some simple addition and subtraction in my QML project. I've got a set of input boxes (prc0-9) that are blank by default (with hint text, but I can't imagine that would affect the results here). From my observations everything works perfectly if there is a number in all the input boxes, but if there is a single blank I get, "nan", in the output box (prof.text). I'd be grateful if someone could help me out here.

You need to add some logic to check if there is a number in each of the boxes.
If there isn't a number, then you can do something like set it to 0 or prompt the user to fill in all boxes before tapping the button.

I finally finished it. I decided to restrict the input mode to numbers and punctuation, so they can't type letters and put in an if statement that changes the field text to 0 if the field is blank on click. Thanks for the help!

CrackBerry is in no way Affiliated with BlackBerry. We take pride in our unbiased content, however do occasionally receive free products from vendors that we review or discuss. For more info click here.