MathGroup Archive 2003

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

Search the Archive

Re: padding in ToString

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43737] Re: padding in ToString
  • From: "Bo Le" <bole79 at email.si>
  • Date: Thu, 2 Oct 2003 02:51:58 -0400 (EDT)
  • References: <blcqom$p8b$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

You can do it like this:


"data-"<>StringJoin[ ToString/@PadLeft[{i},4] ]


Bye, Bo Le


"Konstantin L Kouptsov" <kouptsov at wsu.edu> wrote in message
news:blcqom$p8b$1 at smc.vnet.net...
>
> I generate a filename automatically by using
>
> "data-"<>ToString[i]
>
> however I would like it to be zero padded from the left (so all the
> numbers/names have the same length:
>
> data-0000
> data-0001
>
> How can I do that?
>
>
>
> Konstantin.
>
>


  • Prev by Date: Mathematica stops unexcepted without error and clears variables
  • Next by Date: Re: Slope fields
  • Previous by thread: Mathematica stops unexcepted without error and clears variables
  • Next by thread: Re: padding in ToString