I have numbers outputted from a FORTRAN program in the following format:
0.12961924D+01
How can I parse this as a double using C#?
I have tried the following without success:
// note leading space, FORTRAN pads its output so that positive and negative
// numbers are the same string length
string s = " 0.12961924D+01";
double v1 = Double.Parse(s)
double v2 = Double.Parse(s, NumberStyles.Float)
I would first do some manipulation of this string to get it from FORTRAN to .NET formatting:
The below should get you what you need: