Consider
a = Table[1, 100]
la = Length[a]
b = ScientificForm[a]
lb = Length[b]
la = 100 and lb = 1. This causes problems in my code. How can I make lb have length of 100? Why does ScientificForm change the length of my list?
Consider
a = Table[1, 100]
la = Length[a]
b = ScientificForm[a]
lb = Length[b]
la = 100 and lb = 1. This causes problems in my code. How can I make lb have length of 100? Why does ScientificForm change the length of my list?
This is not an answer, but a comment far too long to appear in comment box.
The documentation article for ScientificForm asserts
ScientificForm acts as a "wrapper", which affects printing but not evaluation.
The documentation is misleading in this case. The wrapper ScientificForm is not transparent to numerical calculations -- it stops them dead. This means you should only apply it to your final calculations after all the numerical work is done.
u = 4234.567890; v = 4200.0;
ScientificForm[u + v]
In the above, because the addition is performed before ScientificForm is applied, it succeeds; while in the following, because the addition is attempted after ScientificForm is applied, it fails.
ScientificForm[u] + v
This discussion applies to all the following wrapper functions.
ScientificForm[List[(* stuff *)]]does indeed have a length of1. What if you doScientificForm /@ a? – J. M.'s missing motivation Oct 18 '18 at 12:21MatrixForm, the most discussions therein are true for all the functions in$OutputForms. – xzczd Oct 18 '18 at 12:27