I have a report that I currently export to Excel in order to format it nicely. I'd like to be able to produce a reasonably well formatted report directly in Mathematica. It looks like I can use Grid
in order to set up the structure of the report. However I'd like to also format the numbers. I see that I can use NumberForm
to handle some of the formatting, but I can't seem to then get the output from NumberForm
to work inside Grid. Probably because NumberForm
"prints" the results. Additionally I have some columns that appear in scientific notation if the number is large enough. I would like that column to have all in scientific notation or none in scientific notation. I tried using ExponentFunction
in NumberForm
, but without begin able to embed NumberForm
results in Grid
it didn't work. I was hoping that there might be some global setting for this threshold.
In addition to the above, I'd appreciate any suggestions about formatting a 2-dimensional table in Mathematica without having to go to Excel.
EDIT - sample:
I haven't gotten as far as headings. I'd want to align the columns. Colums 2 & 4 should probably stay in scientific notation for all numbers. columns 3 & 5 are probably best as integers - I can round them. A sample output, without formatting or headings is as follows.
Grid[Values[joinPMLs[group1CA, group2CA]] /. Missing["Unmatched"] -> "NA"]
NumberForm
to individual entries, ieGrid[Map[NumberForm[#, 2] &, matrix, {2}]]
, notGrid[NumberForm[matrix, 2]]]
See alsoTableForm
$\endgroup$