From: "Michael W. Ryder" <_mwryder@...> Date: 2006-07-23T14:50:12+09:00 Subject: Re: Function for integers to displayed with same number of d Adrian Fraiha wrote: > Michael W. Ryder wrote: >> Adrian Fraiha wrote: >>> Is there or a function, or anyone know of a hack without using if else >>> statements extensivley to have numbers displayed, such as 1 as 0001, 100 >>> as 0100, 1000 as 1000 etc? >>> >>> Anyhelp is appreciated, thanks! >>> >> irb(main):001:0> "%04d" % 1 >> => "0001" > > Hey, thanks to both of you for your help. I had no idea Modulus acted > like that. > It's the first Instance method for the String class in the Pickaxe book.