# How do I Hold the computation for a list or table of fractions?

How do I create a table of fractions of numbers that are in scientific notation that suppresses the evaluation? I've tried using Hold and HoldForm but it always results in error.

particleclass = {10^-6, 10^-5, 10^-4, 10^-3, 10^-2, 10^-1};

alphaTESTwith = {5.261524149346547*^-11, 5.261524149346548*^-9,
5.261524149346547*^-7, 0.000052615241493465474,
0.005261524149346548, 0.5261524149346547};

alphaTESTwithout = {1.4251746149271436*^-11,
1.4251746149271434*^-10, 1.4251746149271435*^-9,
1.4251746149271436*^-8, 1.4251746149271436*^-7,
1.4251746149271436*^-6};

kappa = {1.32751827*^8, 1.32751827*^10, 1.32751827*^12,
1.32751827*^14, 1.3275182700000002*^16, 1.32751827*^18};

l = 1;

alphaKWith = Table[(alphaTESTwith*l)/kappa[[Mass]], {Mass, 1, 6}];
alphaKWithout =
Table[(alphaTESTwithout*l)/kappa[[Mass]], {Mass, 1, 6}];

gridWith = Grid[
Insert[Transpose[
Insert[Transpose[alphaKWith], N@particleclass, 1]]
, Prepend[N@particleclass, "Table"], 1],
Frame -> All]

gridWithout = Grid[
Insert[Transpose[
Insert[Transpose[alphaKWithout], N@particleclass, 1]]
, Prepend[N@particleclass, "Table"], 1],
Frame -> All]


Gives out

• Since l does not appear in the tables, you must have set its value; however, you did not include this value in your code. It is unclear which fractions you want held. This does not appear to be a minimal example. Please show what the intended output should look like for a minimal example. Feb 7, 2022 at 15:41
• Crossposted here. Feb 8, 2022 at 21:45

As you did not specify "l" I set it arbitrarily to 1. Then you can use "ReplaceAll" together with NumberFormat" to write everything in scientific notation. E.g.:

l = 1;
Grid[Insert[
Transpose[Insert[Transpose[alphaKWith], N@particleclass, 1]],
Prepend[N@particleclass, "Table"], 1] /.
x_?NumberQ -> ScientificForm[x], Frame -> All]


• Thank you, this was helpful in fixing the decimal numbered labels above and at the side into scientific form. But I also have another question, how do I convert the scientific numbers on the inside to fractions? Feb 8, 2022 at 6:29
• Why do you want to write a real number as fraction? In general, a real number can not be converted into a fraction without error. And to get some precision you need large denominators. Therefore, what exactly do you want. Something ungainly like 396343/1000000000000000000000000? Feb 8, 2022 at 9:37
• I mean that I wanted to write the expression of the variables alphaTESTwith / kappa and alphaTESTwithout / kappa as fractions but does not evaluate the fraction. I wanted it to be expressed in the form of a scientific number divided by a scientific number. Feb 8, 2022 at 10:07
• Try: MapThread[ScientificForm[#1]/ScientificForm[#2] &, {alphaTESTwith, kappa}] Feb 8, 2022 at 11:08