Thank you,
Raymond

-----Original Message-----
From: Robert Klemme [mailto:shortcutter / googlemail.com] 
Sent: Monday, January 15, 2007 7:00
To: ruby-talk ML
Subject: Re: how to translate base 10 number into base 2 number

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