# Changing threshold for scientific notation from 10^6 so that InputField display is uniform

Related to but different from this question.

I'd like my InputField to display scientific notation not only for numbers larger than one million, but also for smaller numbers. Mathematica (version 10.3 on 64-bit Linux Mint) shows any number larger than 10^6 in scientific notation (whether in an InputField or outside). I want to set this threshold to be lower, at least across all InputField controls in a given module.

What I've tried is to use ScientificForm inside an InputField, but this causes it to look funny.

DynamicModule[{x},
Grid[{
{Manipulator[Dynamic[x], {10^5, 2*10^6}]},
{InputField[Dynamic[ScientificForm[x, 2]]]},
{InputField[Dynamic[x, 2]]}
}]
]


When sliding beyond 10^6, it looks like:

I would like to have the same precision as the top InputField across all number ranges, while keeping the formatting as the second InputField, without the quotes. I thought I might be able to use \$PrePrint but I wasn't sure how. I'd appreciate any help getting this to work.

One can simply set the ShowStringCharacters->False option in the Style of the InputField:

DynamicModule[{x},
Grid[{
{Manipulator[Dynamic[x], {10^5, 2*10^6}]},
{InputField[Dynamic[Style[ScientificForm[x, 2], ShowStringCharacters -> False]]]},
{InputField[Dynamic[x, 2]]}
}]
]


I've succeeded in doing this to my satisfaction. It's rather crude, and uses Defer to keep the number in exponent form. There may be a more elegant way to do this (comments appreciated), but this works for simple cases.

ScientificFormNumber[x_, precision_] := Block[{mantissa, exponent},
{mantissa, exponent} = MantissaExponent[x];
N[Round[(mantissa*10*10^(precision-1))]/10^(precision-1)]*
Defer[10]^(exponent - 1)
];

DynamicModule[{x},
Grid[{
{Manipulator[Dynamic[x], {10^5, 2*10^6}]},
{InputField[Dynamic[ScientificForm[x, 2]]]},
{InputField[Dynamic[ScientificFormNumber[x, 2]]]},
{InputField[Dynamic[x, 2]]}
}]
]