Re: [R] Paddding an integer with zeros

2008-10-21 Thread culpritNr1
sprintf works like a charm. I feel rather embarrassed right now. I see that when I do ?format, at the very end of the documentation, sprintf is suggested as further reading. muito obrigado culpritNr1 Henrique Dallazuanna wrote: > > Try this: > > formatC(12, width = 5, flag = "0") > or > s

Re: [R] Paddding an integer with zeros

2008-10-21 Thread Henrique Dallazuanna
Try this: formatC(12, width = 5, flag = "0") or sprintf("%05d", 12) On Tue, Oct 21, 2008 at 3:24 PM, culpritNr1 <[EMAIL PROTECTED]> wrote: > > Hello List, > > Can anybody point me to a number-to-string formatting function? > > I need to convert, say, 12 to 00012. > > I tried format() but its too