Hi, I'm trying to convert a string to double but this error always occurs: An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
While myReader.Peek() <> -1
Label1.Text = myReader.ReadLine()
Dim test As String = Label1.Text
Dim lat1 As String
Dim lon1 As String
lat1 = test.Substring(0, 11)
lon1 = test.Substring(15, 8)
Dim dlat1 As Double
Dim dlon1 As Double
dlat1 = System.Convert.ToDouble(lat1)
dlon1 = System.Convert.ToDouble(lon1) <- code in error It is the same even if i use CDbl
Myevent.AutoRead(dlat1, dlat1)
End While
The attachment below is what i am trying to convert:
103.008764, n, 1.2088983, e
While myReader.Peek() <> -1
Label1.Text = myReader.ReadLine()
Dim test As String = Label1.Text
Dim lat1 As String
Dim lon1 As String
lat1 = test.Substring(0, 11)
lon1 = test.Substring(15, 8)
Dim dlat1 As Double
Dim dlon1 As Double
dlat1 = System.Convert.ToDouble(lat1)
dlon1 = System.Convert.ToDouble(lon1) <- code in error It is the same even if i use CDbl
Myevent.AutoRead(dlat1, dlat1)
End While
The attachment below is what i am trying to convert:
103.008764, n, 1.2088983, e