MathGroup Archive 2002

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

Search the Archive

RE: Re: newbie question - printing Pi

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33391] RE: [mg33386] Re: [mg33369] newbie question - printing Pi
  • From: David.Annetts at csiro.au
  • Date: Wed, 20 Mar 2002 01:52:51 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Tomas,
> 
> Strings must be used in order to preserve the five-digit 
> objects beginning
> with a zero.

Is this strictly true?  

Using NumberPadding, we have the following ... (excusing InputForm)

In[107]:=
z =  12345

Out[107]=
12345

In[115]:=
z1 =PaddedForm[z,8]

Out[115]//PaddedForm=
    12345

In[111]:=
z2 = PaddedForm[z, 8, NumberPadding->{"0", ""}]

Out[111]//PaddedForm=
000012345

In[116]:=
TableForm[{z, z1, z2}, TableAlignments->Right]

Out[116]//TableForm=
\!\(\*
  InterpretationBox[GridBox[{
        {"12345"},
        {
          TagBox[
            InterpretationBox["\<\"    12345\"\>",
              12345,
              Editable->False],
            (PaddedForm[ #, 8]&)]},
        {
          TagBox[
            InterpretationBox["\<\"000012345\"\>",
              12345,
              Editable->False],
            (PaddedForm[ #, 8, NumberPadding -> {"0", ""}]&)]}
        },
      RowSpacings->1,
      ColumnSpacings->3,
      RowAlignments->Baseline,
      ColumnAlignments->{Right}],
    TableForm[ {12345, 
      PaddedForm[ 12345, 8], 
      PaddedForm[ 12345, 8, NumberPadding -> {"0", ""}]}, TableAlignments ->

      Right]]\)

Regards,

Dave.
--------------------------------------------------------
  Dr. David Annetts             EM Modelling Analyst
  Tel: (+612) 9490 5416         CSIRO DEM, North Ryde
  Fax: (+612) 9490 5467         David.Annetts at csiro.au
                 Include "usual_disclaimers"
--------------------------------------------------------


  • Prev by Date: Re: Creating List of Sequence Iterates
  • Next by Date: RE: Creating List of Sequence Iterates
  • Previous by thread: Re: newbie question - printing Pi
  • Next by thread: Re: RE: Re: newbie question - printing Pi