Error messages when app runs on phone with AI companion but works fine when tested on emulator

I'm getting an error that relates to the logic test for a custom calculator I have been working on. The math works out in excel and when I tested it using the android simulator it was working great. Today I am testing using an iPhone running the AI companion. The user needs to enter 2 numbers for the calculation both are in textboxes which I have set to numbers only. From trial and error I have determined that when typing in a 3 place decimal, (or any number that is a decimal) if there is no number in the 1's place it will not work but adding a zero here seems to fix it. I don't want to depend on the user to enter the leading zero I just want it to calculate. I haven't been able to find any information that will help with this. For instance typing in [.999] will cause the error while [0.999] is ok any number regardless of significant digits seems to work as long as there is a number to the left of the decimal. Something about the logic doesn't like it.

Another possibly related behavior that doesn't make sense to me is why changing a textbox to numbers only kicks it from the math box "textbox text > ### " is ok but "textbox numbers only" wont work there? I don't get it... Am I making any sense here? I'm very close to finishing this app I do have one other problem but I want to fix but lets focus on this one first so I don't drive everyone nuts hahaha :slight_smile:

Here's a better look at my blocks:

1 Like

From the error message it appears to not like your conditional test here:

image

Might I also suggest that you set all your textboxes to 0 instead of empty.

It could also be a bug in Appinventor on iOS companion.

2 Likes

I'm leaning toward bug in this case. App Inventor in numerical tests tries to coerce its arguments to numbers first before the check, and the error suggests that it is upset about the first argument being a string...

2 Likes

Ok thanks for the input i'm going to test tomorrow on an android device to determine if error persists.

1 Like

Yes, if NumbersOnly is enabled there is only a comma and no dot (on iOS).

Try something like this (don't enable NumbersOnly):