Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

RE: padding in ToString

  • To: mathgroup at
  • Subject: [mg43718] RE: [mg43701] padding in ToString
  • From: "David Park" <djmp at>
  • Date: Thu, 2 Oct 2003 02:51:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Here is one method.

filename[i_] := 
  "data-" <> ToString[NumberForm[i, 3, NumberPadding -> {"0", ""}]]


David Park
djmp at 

From: Konstantin L Kouptsov [mailto:kouptsov at]
To: mathgroup at

I generate a filename automatically by using


however I would like it to be zero padded from the left (so all the 
numbers/names have the same length:


How can I do that?


  • Prev by Date: Re: padding in ToString
  • Next by Date: Re: Eigenvalues, any suggestions?
  • Previous by thread: Re: padding in ToString
  • Next by thread: Re: padding in ToString