From: "Brian Schröder" Date: 2005-05-26T07:23:19+09:00 Subject: Re: Zerofy On 26/05/05, Vance Heron wrote: > Try something like > def zerofy! > sprintf("%02d", self) > end > or class Numeric def pad(length) "%0#{length}i" % self end end 10.pad(3) => "010" regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/