ToString Awkwardness
- To: mathgroup at smc.vnet.net
- Subject: [mg126848] ToString Awkwardness
- From: "Kevin J. McCann" <kjm at KevinMcCann.com>
- Date: Wed, 13 Jun 2012 04:55:34 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
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
- Follow-Ups:
- Re: ToString Awkwardness
- From: James Stein <mathgroup@stein.org>
- Re: ToString Awkwardness
- From: Christoph Lhotka <christoph.lhotka@fundp.ac.be>
- Re: ToString Awkwardness
- From: Bob Hanlon <hanlonr357@gmail.com>
- Re: ToString Awkwardness
- From: Tomas Garza <tgarza10@msn.com>
- Re: ToString Awkwardness