From: Bob Hanlon on 13 Jun 2010 04:09 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 13 Jun 2010 04:10 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
First
|
Prev
|
Pages: 1 2 Prev: Automatic update of variables Next: How to center the position of a control in the |