MathGroup Archive 2000

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

Search the Archive

Re: PrintPrecision

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23182] Re: PrintPrecision
  • From: paulh at wolfram.com (P.J. Hinton)
  • Date: Fri, 21 Apr 2000 00:47:09 -0400 (EDT)
  • Organization: "Wolfram Research, Inc."
  • References: <8djlqq$7rj@smc.vnet.net> <8do0ak$hva@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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: Remote kernel with ssh
  • Next by Date: Help, my MathLink Examples segfault.
  • Previous by thread: Re: Re: PrintPrecision
  • Next by thread: Re: PrintPrecision