# Would like all numbers to be in scientific notation

I'm trying to get output with all of my numbers in scientific notation. Mathematica doesn't seem to use scientific notation until the exponent is 6. These are all machine numbers. I thought I could use NumberForm and put a formula in for ExponentFunction using Log[10,x] to force the exponent.

So I did this:

NumberForm[123456., ExponentFunction -> (Floor[Log[10, 123456.]] &)]


However, when I try this and reference the number, as follows, it doesn't work.

NumberForm[123456., ExponentFunction -> (Floor[Log[#]] &)]


What am I doing wrong?

• For debugging, you could do NumberForm[123456., ExponentFunction -> ((Print[{##}]; Floor[Log[#]]) &)] to see what arguments are fed to the pure function. Apr 13, 2017 at 22:02
• @CarlWoll Thank you for that. Clearly I didn't understand how the pure function worked. I'm still a little confused, but at least I can now use it in this context. Apr 14, 2017 at 13:04

list = 123.456*10^Range[-6, 6];

There is also EngineeringForm
EngineeringForm[list]

• Or, if one really wants to use NumberForm: NumberForm[list, ExponentFunction -> (1 Quotient[#, 1] &)] and NumberForm[list, ExponentFunction -> (3 Quotient[#, 3] &)], respectively. Apr 13, 2017 at 21:59