I am trying to output numbers to a file to be read by another program. What I want is always of the format d.dddddddded. I got close using ScientificForm with the NumberFormat option.
fortran[n_] :=
ScientificForm[n, 9, NumberFormat -> (Row[{#1, "e", #3}] &)]
But there is one issue: When the ScientificForm would have exponent = 0, the exponent (read by #3 in NumberFormat) apparently returns nothing instead of 0, so a number like 1.23 prints outputs the string 1.23e instead of 1.23e0. Any ideas?
Thanks, David