G
Guest
Hi,
I'm having a problem parsing strings (comming from a flat text input file)
to doubles.
the code:
currentImportDetail.Result = CType(line.Substring(7, 8).Trim(" "),
System.Double)
What is in my Watch:
line.Substring(7, 8).Trim(" ") "0.006000"
CType(line.Substring(7, 8).Trim(" "), System.Double) 6000.0
System.Decimal.Parse(line.Substring(7, 8).Trim(" ")) 6000D
cDec(line.Substring(7, 8).Trim(" ")) 6000D
cdbl(line.Substring(7, 8).Trim(" ")) 6000.0
I tried to use the other parse methods but for an unknown reason the result
is false and I don't know why.
My regional settings are currently Dutch(Belgium), but since he parses the
string to 6000 point 0 and not comma, I doubt that the regional settings are
the reason why it isn't parsing my data like I want.
I'm having a problem parsing strings (comming from a flat text input file)
to doubles.
the code:
currentImportDetail.Result = CType(line.Substring(7, 8).Trim(" "),
System.Double)
What is in my Watch:
line.Substring(7, 8).Trim(" ") "0.006000"
CType(line.Substring(7, 8).Trim(" "), System.Double) 6000.0
System.Decimal.Parse(line.Substring(7, 8).Trim(" ")) 6000D
cDec(line.Substring(7, 8).Trim(" ")) 6000D
cdbl(line.Substring(7, 8).Trim(" ")) 6000.0
I tried to use the other parse methods but for an unknown reason the result
is false and I don't know why.
My regional settings are currently Dutch(Belgium), but since he parses the
string to 6000 point 0 and not comma, I doubt that the regional settings are
the reason why it isn't parsing my data like I want.