When Mathematica converts numbers with large exponents to strings, it has the habit of creating a multi-line string:
Code: Select all
ToString[2.99597*^-19]
-19
2.99597 10
A fix seems to be to encapsulate getWidthNumerical[list[[i,1]],j,k] in FortranForm before calling ToString:
Code: Select all
WriteString[varsFile, InsString[CalcHepWidth[list[[i,1]],j,k],lVN] <>"|" <> InsString[ToString[FortranForm[getWidthNumerical[list[[i,1]],j,k]]],lVV]<>"| width \n"];
Josh