Yves Mazzon Member Licensed User Longtime User Sep 13, 2015 #1 In my application when run on my Samsung S4 I get this message: "An error has occurred in sub:main_calculation(java line:523) Java.lang. numberFormatExeption: Invalid double:"". " I am at lost here. I know that I have a sub that is called Calculation but reading my code again and again can't find what is triggering the error. My question is what shall I look for: Basically in my Calculation sub, numerical values are transferred to declared variables and then some math are performed. Many thanks Yves
In my application when run on my Samsung S4 I get this message: "An error has occurred in sub:main_calculation(java line:523) Java.lang. numberFormatExeption: Invalid double:"". " I am at lost here. I know that I have a sub that is called Calculation but reading my code again and again can't find what is triggering the error. My question is what shall I look for: Basically in my Calculation sub, numerical values are transferred to declared variables and then some math are performed. Many thanks Yves
LucaMs Expert Licensed User Longtime User Sep 13, 2015 #2 Anywhere Software, can I answer so each time a question is not specified enough? Upvote 0
R Roycefer Well-Known Member Licensed User Longtime User Sep 13, 2015 #3 This is most likely caused by your app trying to parse user input into a numerical variable (like a Double) but that input not being numerical in nature. Look at how your app validates user input. Upvote 0
This is most likely caused by your app trying to parse user input into a numerical variable (like a Double) but that input not being numerical in nature. Look at how your app validates user input.
wonder Expert Licensed User Longtime User Sep 13, 2015 #4 Can you post the Calculation sub? It seems that a String is being fed into a Double variable. Upvote 0
Yves Mazzon Member Licensed User Longtime User Sep 15, 2015 #5 Hi, I fond where the error came from. I got that error if the string is empty in the labels where the numerical values has to be entered. So I put some condition to avoid this error by putting some guards in the program. Many thanks. Upvote 0
Hi, I fond where the error came from. I got that error if the string is empty in the labels where the numerical values has to be entered. So I put some condition to avoid this error by putting some guards in the program. Many thanks.
Erel B4X founder Staff member Licensed User Longtime User Sep 15, 2015 #6 IsNumber can be useful for such cases: Code: If IsNumber(EditText1.Text) Then x = EditText1.Text + 10 Upvote 0
IsNumber can be useful for such cases: Code: If IsNumber(EditText1.Text) Then x = EditText1.Text + 10
Yves Mazzon Member Licensed User Longtime User Sep 15, 2015 #7 Erel said: IsNumber can be useful for such cases: Code: If IsNumber(EditText1.Text) Then x = EditText1.Text + 10 Click to expand... Thanks Erel Upvote 0
Erel said: IsNumber can be useful for such cases: Code: If IsNumber(EditText1.Text) Then x = EditText1.Text + 10 Click to expand... Thanks Erel