A anaylor01 Well-Known Member Licensed User Longtime User May 29, 2011 #1 I am getting an error on this code when it goes over a 1000. lblscore.Text = NumberFormat(lblscore.Text + 10,0,0)
I am getting an error on this code when it goes over a 1000. lblscore.Text = NumberFormat(lblscore.Text + 10,0,0)
S Smee Well-Known Member Licensed User Longtime User Dec 24, 2011 #2 was there an answer to this? I am getting the same error Upvote 0
vb1992 Well-Known Member Licensed User Longtime User Dec 24, 2011 #3 I was getting errors too, thought it was me Upvote 0
NJDude Expert Licensed User Longtime User Dec 24, 2011 #4 You have to enclose 'lblscore.Text + 10' in parenthesis: B4X: lblscore.Text = NumberFormat((lblscore.Text + 10), 0, 0) Last edited: Dec 24, 2011 Upvote 0
You have to enclose 'lblscore.Text + 10' in parenthesis: B4X: lblscore.Text = NumberFormat((lblscore.Text + 10), 0, 0)
S Smee Well-Known Member Licensed User Longtime User Dec 25, 2011 #5 @ NJDude That works. Thanks very much. I could not recall seeing anything in the documentation about that Upvote 0
@ NJDude That works. Thanks very much. I could not recall seeing anything in the documentation about that
S Smee Well-Known Member Licensed User Longtime User Dec 25, 2011 #6 Whoops, No it does'nt work. I had it in a catch try block. When i removed i got the error again B4X: CustTotal=NumberFormat2((CustTotal),0,2,2,True) java.lang.NumberFormatException: Invalid double: "1,117.78" at org.apache.harmony.luni.util.FloatingPointParser.invalidReal(FloatingPointParser.java:78) Upvote 0
Whoops, No it does'nt work. I had it in a catch try block. When i removed i got the error again B4X: CustTotal=NumberFormat2((CustTotal),0,2,2,True) java.lang.NumberFormatException: Invalid double: "1,117.78" at org.apache.harmony.luni.util.FloatingPointParser.invalidReal(FloatingPointParser.java:78)
NJDude Expert Licensed User Longtime User Dec 25, 2011 #7 That's because you have CustTotal DIMmed as a Double and you are assigning a non-numeric value (is non numeric because it contains a comma). Upvote 0
That's because you have CustTotal DIMmed as a Double and you are assigning a non-numeric value (is non numeric because it contains a comma).