From: Bob Hanlon on
data = {1, 9, 10, 90};

IntegerString[#, 10, 3] <>
".gif" & /@ data

{001.gif,009.gif,010.gif,090.gif}


Bob Hanlon

---- Rui <rui.rojo(a)gmail.com> wrote:

=============
I need to create strings out of integers, padding them with zeros,
cause otherwise they end up sorted in the wrong order. "10.gif" before "1.gif".
For now I'm gonna do it by adding 1000, converting to string, and
taking the heading 1, but I'm sure there are better options. THanks

Rui



From: Albert Retey on
Am 12.06.2010 11:32, schrieb Rui:
> I need to create strings out of integers, padding them with zeros,
> cause otherwise they end up sorted in the wrong order. "10.gif" before "1.gif".
> For now I'm gonna do it by adding 1000, converting to string, and
> taking the heading 1, but I'm sure there are better options. THanks

You are looking for IntegerString, e.g.:

IntegerString[1, 10, 3]

hth,

albert