I want to control the number of decimal points in the output file.
input={33.04177277115046 + 8.9984286747054116/e^4,
1.56875 + 1.52284*10^-7/e^4 }
I want to export it in a file with say 4
decimal points to be printed.
(not working: Exporting data to txt file)
Expected output
{33.0418 + 8.9984/e^4,
1.5688 + 1.5228*10^-7/e^4 }
.0001
it should be printed in scientific notation with 5 digits of precision, but if it is more than.0001
it should be printed in decimal notation with 4 digits of accuracy? Seems odd. $\endgroup$1.5688 + 0.0000/e^4
inside the output file which I failed to produce so far. The problem is I need to keep track it is0.0000/e^4
Not just0.0000
$\endgroup$input /. Plus[x_, Times[y_, z_Power]] :> ToString@NumberForm[x, {\[Infinity], 4}] <> " + " <> ToString@NumberForm[Round[y, 0.0001], {\[Infinity], 4}] <> "/" <> ToString[z[[1]]] <> "^" <> ToString[-z[[2]]]
$\endgroup$