From: Luis Parravicini Date: 2007-06-01T01:13:44+09:00 Subject: Re: Number formatting On 5/31/07, Cory wrote: > folks - can't quite figure this one out... > > foo = 5 > bar = 10 > > basically - when i go to print out the numbers - i want to format 'foo' > with a leding zero so that it reads '05' and is aesthetically pleasing > when compared to a double-digit number - such as bar: '10'. Try using Kernel#printf. irb(main):001:0> printf("%02d", 5) 05=> nil -- Luis Parravicini http://ktulu.com.ar/blog/