On 15.01.2007 12:54, Jacob, Raymond A Jr wrote:
> Is there a way to pad the result with leading zeros
> i.e. 4.to_s(2)
> "100"

irb(main):004:0> "%08b" % 4
=> "00000100"
irb(main):005:0> sprintf "%08b", 4
=> "00000100"

	robert