Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: question of formatting with PaddedForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28583] Re: [mg28556] question of formatting with PaddedForm
  • From: "Sherman Reed" <sherman.reed at worldnet.att.net>
  • Date: Sat, 28 Apr 2001 21:36:08 -0400 (EDT)
  • References: <200104270756.DAA12785@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
I read a bit more of the Help file and compared the examples to your work,
did some rearranging to make them similar and got the following result,
which I think
is what you wanted.

In[8]:=
For[i = 98, i <= 105,i++,
  Print[PaddedForm[i,3,NumberPadding->{"0","0"},NumberSigns->{"",""}]]
]


098

099

100

101

102

103

104

105
Sherman C. Reed
sherman.reed at att.net
----- Original Message -----
From: <jabauer at oanet.com>
To: mathgroup at smc.vnet.net
Subject: [mg28583] [mg28556] question of formatting with PaddedForm


> Hello all,
>
> I am having some difficulties getting a formatted output to look like I
> 'think' it should look. What I want looks like this (three digits, padded
> with leading zeros for numbers less than 100):
>
> 098
> 099
> 100
> 101
> 102
> 103
> 104
> 105
>
>
> But, when I try this:
>
> For[i = 98, i <= 105,
>   Print[PaddedForm[i, 2, NumberPadding -> {"0", "0"},
> SignPadding ->
> False]];
>   i++]
>
>
> I get this:
>
> 098
> 099
> 0100
> 0101
> 0102
> 0103
> 0104
> 0105
>
>
> I only want three digits, not the extra leading zero for values >= 100.
Can
> anyone point me in the right direction? Thanks in advance.
>
>         Jim
>
> ps - I tried to post this a couple of days ago but it didn't show up.
>
>
>
>
>
>  -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the
eb  -----
>   http://newsone.net/ -- Free reading and anonymous posting to 60,000+
groups
>    NewsOne.Net prohibits users from posting spam.  If this or other posts
> made through NewsOne.Net violate posting guidelines, email
abuse at newsone.net
>



  • Prev by Date: Re: Interior of a polygon
  • Next by Date: Re: Re: how to be as efficient as Mean[list] - efficient summing of function applied to list
  • Previous by thread: Re: question of formatting with PaddedForm
  • Next by thread: Re: question of formatting with PaddedForm