Hello everyone,
I am trying to parse int32 value from API to double in B4A but unfortunately it shows error java.lang.NumberFormatException. For API, i use C#.net. I insert my code:
and the error shows:
Please help me to find the problem. Thanks in Advance.
I am trying to parse int32 value from API to double in B4A but unfortunately it shows error java.lang.NumberFormatException. For API, i use C#.net. I insert my code:
B4X:
Sub BtnKot_Click
Dim job_5, job_6 As HttpJob
job_5.Initialize("job", Me)
job_6.Initialize("", Me)
' job_5.PostString("http://192.168.1.4/posapi/insertKot/addkot",JSON)
job_6.Download("http://192.168.1.4/posapi/kot/selectdata")
k = 0
k = m.get("KotNo")
For i = 0 To Grid.RowCount - 1
job_5.Download2("http://192.168.1.4/posapi/insertKot/addkot", _
Array As String("kotno",k,"itemcode","S","itemcategory","food","unqno",2,"reason","vcsdawre","rate",Grid.GetValue(i,2),"amount",Grid.GetValue(i,3),"quantity",Grid.GetValue(i,1),"taxrate",3,"preferencepckey",123,"kotdate",DateTime.Now,"status","A","itempckey",1234))
k = k + 1
Next
Wait For (job_5) JobDone(job_5 As HttpJob)
If job_5.Success Then
Log(job_5.GetString)
' = job_5.GetString
Else
' = job_5.ErrorMessage
ToastMessageShow(job_5.ErrorMessage,True)
Return
End If
job_5.Release
job_6.Release
End Sub
and the error shows:
B4X:
Error occurred on line: 187 (Billing)
java.lang.NumberFormatException
at org.apache.harmony.luni.util.FloatingPointParser.parseDblImpl(Native Method)
at org.apache.harmony.luni.util.FloatingPointParser.parseDouble(FloatingPointParser.java:283)
at java.lang.Double.parseDouble(Double.java:318)
at anywheresoftware.b4a.debug.RDebugUtils.numberCast(RDebugUtils.java:55)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Please help me to find the problem. Thanks in Advance.