Scientific notation for any number NOT for axes

How can a double be output via printf to display like: 4.56 x10^7 ? BUT, where the 7 is printed as an exponent with the need for the “^” character?

I know how to use %e or %E, I don’t like how they look and I haven’t yet found the rights words to google that get me to any info on any forum that have already addressed this.

I’ve looked through TText and TLatex, but I’m not finding what I need…

help!!

Jeremy

TLatex is the solution to draw numbers with exponent on the graphics output (canvas).

Which TLatex method would solve this? I’ve looked, but I don’t see how to do it.

Would you please reply with a snippet that can be paste into an interactive session that would print 12345678, as 1.23x10^7 to a TCanvas.

Thanks!

{
   TString text;
   text = Form("%5.3g", 12345678.);
   text.ReplaceAll("e+0","x10^{");
   text.Append("}");
   TLatex *t = new TLatex(.5,.5, text.Data());
   t->Draw();
}

=D> Thank you!