Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10439 > unrolled thread

ToString Awkwardness

Started by"Kevin J. McCann" <kjm@KevinMcCann.com>
First post2012-06-13 08:57 +0000
Last post2012-06-14 09:28 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  ToString Awkwardness "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-06-13 08:57 +0000
    Re: ToString Awkwardness Peter Breitfeld <phbrf@t-online.de> - 2012-06-14 09:28 +0000

#10439 — ToString Awkwardness

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2012-06-13 08:57 +0000
SubjectToString Awkwardness
Message-ID<jr9kl4$3kg$1@smc.vnet.net>
I have several plots with annotation that includes parameter values. I 
am using ToString inside a Text command to do this, and all is well 
unless the values are small so that the results are in scientific 
notation. When this happens, I get something like this:

"f(x) = " <> ToString[8.71 10^-15]

f(x) =        -15
        8.71 10

Which is a bit awkward looking in the plot. Upon further investigation, 
I looked at the FullForm of the above and got:

"f(x) =        -15\n8.71 10"

So, I see why the output "looks funny". The exponent is treated 
separately from the 10. Any suggestions for nicer looking output?

Thanks,

Kevin

[toc] | [next] | [standalone]


#10469

FromPeter Breitfeld <phbrf@t-online.de>
Date2012-06-14 09:28 +0000
Message-ID<jrcas5$do6$1@smc.vnet.net>
In reply to#10439
"Kevin J. McCann" wrote:

> "f(x) = " <> ToString[8.71 10^-15]

Best (?) I think, is to use Row:

Row[{"f(x) = ", 8.71 10^-15}]

-- 
_________________________________________________________________
Peter Breitfeld | Bad Saulgau, Germany | http://www.pBreitfeld.de

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web