I have a
list1 = {1, 23, 4, 14} (*max entry is 99*)
and want to create from that another
list2 = {01, 23, 04, 14}
preceding zeros if the number is less than 10.
How can I do that?
I have a
list1 = {1, 23, 4, 14} (*max entry is 99*)
and want to create from that another
list2 = {01, 23, 04, 14}
preceding zeros if the number is less than 10.
How can I do that?
IntegerString[list1, 10, 2]
Note that the resulting list consists of strings and not numbers. But maybe that is sufficient for your application?
NumberFormshould work... – Yves Klett Dec 20 '18 at 13:55NumberForm– lio Dec 20 '18 at 14:16