Android Question B4X Why this error?

Mauricio Pereira

Member
Licensed User
Longtime User
The following error appears in the simple attached program:
Error occurred on line: 39 (Main)
java.lang.NumberFormatException: Invalid double: "2,000.88"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.initialParse(StringToReal.java:164)
at java.lang.StringToReal.parseDouble(StringToReal.java:282)

......
Why ??
 

Attachments

  • Test.zip
    74.8 KB · Views: 164

DonManfred

Expert
Licensed User
Longtime User
You are using a Formatted Double (x) to check if the value is greater than 999. Do such tests on the Double.
B4X:
If A > 999 Then
        Log(X)
    Else
        Log(X)   
    End If
 
Upvote 0
Top