1
$\begingroup$

I am using ScientificForm to display my numbers. For example:

Style[ScientificForm[500000., NumberPoint -> Automatic], Black, 
 FontSize -> 50, FontFamily -> "Arial"]

gives the following result:

enter image description here

How do I reduce the spacing between the x and the two numbers?

$\endgroup$

3 Answers 3

3
$\begingroup$

You could add an AdjustmentBox

Manipulate[
  Style[ScientificForm[500000., NumberPoint -> Automatic], Black, FontSize -> 50, FontFamily -> "Arial"] //
    ToBoxes //
    ReplaceAll[s : SuperscriptBox[__] :> AdjustmentBox[s, BoxMargins -> {{-shift, 0}, {0, 0}}]] //
    DisplayForm, 
  {shift, 0, .5}
]

manipulate

$\endgroup$
3
$\begingroup$

Try the NumberFormat option:

NumberFormat -> (Row[{#1, "\[Times]", Superscript[#2, #3]}] &)

So, the full expression:

Style[
  ScientificForm[500000., 
    NumberFormat -> (Row[{#1, "\[Times]", Superscript[#2, #3]}] &), 
    NumberPoint -> Automatic], 
  Black, FontSize -> 50, FontFamily -> "Arial"]
$\endgroup$
2
$\begingroup$
Clear["Global`*"]

x = 500000.;

{man, exp} = {10*#[[1]], #[[2]] - 1} &@MantissaExponent[x]

(* {5., 5} *)

Using no space

Style[Row[{Round@man, "\[Times]", Superscript[10, exp]}], Black, 
 FontSize -> 50, FontFamily -> "Arial"]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.