Re: padding in ToString
- To: mathgroup at smc.vnet.net
- Subject: [mg43719] Re: padding in ToString
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Thu, 2 Oct 2003 02:51:13 -0400 (EDT)
- References: <blcqom$p8b$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Table["data-"<>ToString[ NumberForm[i, 3, NumberPadding->"0"]], {i,0,5}] {data-0000,data-0001,data-0002,data-0003,data-0004,data-0005} Table["data-"<>ToString[ PaddedForm[i, 3, NumberPadding->"0"]], {i,0,5}] {data-0000,data-0001,data-0002,data-0003,data-0004,data-0005} Bob Hanlon In article <blcqom$p8b$1 at smc.vnet.net>, Konstantin L Kouptsov <kouptsov at wsu.edu> wrote: << 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?