I have a table with values exported from a statistics software, where the values are formatted like this (see example below):
Some (very small ones) are in scientific notation, some are in "normal" decimal notation.
\begin{tabular}{r}
3,158722 \\
-0,00061 \\
6,28E-05 \\
0,000303 \\
1,67E-04 \\
0,000175 \\
-0,00017 \\
0,000025 \\
-0,00012 \\
-7,7E-05 \\
-0,00042 \\
-0,0005 \\
0,128871 \\
-0,00689 \\
0,004255 \\
-0,00245 \\
0,010475 \\
0,007083 \\
0,000852 \\
0,004583 \\
-0,00042 \\
0,002032 \\
-0,00111 \\
0,000556 \\
12,53887 \\
0,0024 \\
-0,00387 \\
0,002836 \\
-0,00052 \\
-0,00022 \\
5,41E-05 \\
-0,00063 \\
3,17E-04 \\
0,000187 \\
-0,08153 \\
-0,07881 \\
0,316826 \\
0,001066 \\
0,009783 \\
-0,02701 \\
0,006054 \\
0,004167 \\
\end{tabular}%
- How can I define a number formatting that makes sense?
- Is it possible with
siunitx
to combine decimal and scientific notation in one column?
If yes, how can I define when the scientific notation is used and when not?
Best Answer
While
siunitx
is good at aligning a series of numbers in a similar format, it is less good for this type of mixed input. My initial thought would bebut this will have too much space on the right margin. Perhaps a new option is needed in
siunitx
to handle this case.One alternative approach is to use a strategy similar to the
dcolumn
package, making both,
andE
active in math mode:Of course, the problem then is that there are no digit separators.