Mathematica has several number formats such as ScientificForm
, EngineeringForm
, etc. Are there any that can be configured to omit a redundant decimal point, or alternatively: work on exact numbers?
I want either
myForm[2.*10^10]
$2\times 10^{10}$
or
myForm[2*10^10]
$2\times 10^{10}$
(Of course for 2.5*10^10
the decimal point would be required.)
With ScientificForm
, I get
ScientificForm[2.*10^10]
$2.\times 10^{10}$
ScientificForm[2*10^10]
$20000000000$
I can piece the result together with strings or HoldForm
, but my question is: is there a builtin solution?
Why do I think there may be a builtin way? Because of the tick marks here:
Graphics[{Circle[{0, 0}, 10^10]}, Frame -> True]
It is however possible that this formatting is done by the front end and isn't available in the kernel.
What is this needed for? Precisely for tick labels. I know that a reasonable workaround for this application is using $2.0\times 10^{10}$, and I have been using that in the past. This time I want simply $2$ instead of $2.0$ or $2.$.