From: Joel VanderWerf Date: 2006-11-12T03:49:28+09:00 Subject: Re: sprintf bug (?) Peter Szinek wrote: > Hello all, > > I am wondering if I have just found a bug in (s)printf... > > According to the PickAxe, table "sprintf flag characters": > > ================= snip ================================== > > 0 (zero) all Pad with zeros, not spaces. > > ================= snip ================================== > > so I think this call > > irb(main):053:0> sprintf("%05s", 123) > => " 123" > > should correctly result in > > "00123" > > or I am getting something wrong? I think ruby follows the C standard, which says zero padding only applies to numeric formats. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407