MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PrintPrecision

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23190] Re: PrintPrecision
  • From: "JR" <jrabel at holadayinc.com>
  • Date: Mon, 24 Apr 2000 01:12:00 -0400 (EDT)
  • References: <8djlqq$7rj@smc.vnet.net> <8do0ak$hva@smc.vnet.net> <8domra$jpg@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Mr. Hinton,

The example you give below writes numbers with exponents in the 20000 x 10^7
format.  How can I get it in fortran format (i.e. 2.0000e7)?

Thank you for your reply,
jr

P.J. Hinton <paulh at wolfram.com> wrote in message
news:8domra$jpg at smc.vnet.net...
> In article <8do0ak$hva at smc.vnet.net>,
>  Ronald Bruck <bruck at math.usc.edu> writes:
>
> > I'm sick to death of the bizarre formatting rules which Mathematica
> > uses.  I want a plain, simple, fixed-format, in which a "1" will print
> > as a "1.0000" (NOT "1.") and a "1.39281" will print as a "1.3928" and a
> > "1.31" will print as a "1.3100".  I've tried NumberForm, I've tried
> > PaddedForm, I've tried writing the damned things to a file--and I cannot
> > get the simple, classical, traditional "f6.4".  HOW DO I DO THIS?!
> >
> > And when I print it to a file, I **don't** want to find the file filled
> > with a bunch of "NumberForm[..."'s.
> >
> > And as I mentioned in another post, **my** Options Inspector won't make
> > any changes.
>
> Surely you must have overlooked using PaddedForm[] like this?
>
> In[1]:= ToString[PaddedForm[#, {6, 4}]]& /@ {1., 1.39281, 1.31}
>
> Out[1]= {  1.0000,   1.3928,   1.3100}
>
> In[2]:= Export["testme.dat", %, "List"]
>
> Out[2]= testme.dat
>
> In[3]:= !! "testme.dat"
>   1.0000
>   1.3928
>   1.3100
>
> ToString[] is used to capture the textual representation emitted
> by PaddedForm[].
>
> --
> P.J. Hinton
> Mathematica Programming Group           paulh at wolfram.com
> Wolfram Research, Inc.
> Disclaimer: Opinions expressed herein are those of the author alone.
>




  • Prev by Date: Re: Demonstrate that 1==-1
  • Next by Date: Re: fastest way to do pair-sum / make pair-list
  • Previous by thread: Re: PrintPrecision
  • Next by thread: Mathematica TeX files