From: Gregory Brown Date: 2008-09-10T22:33:21+09:00 Subject: Re: Please explain that On Wed, Sep 10, 2008 at 9:24 AM, Jan Pilz wrote: > Can you please explain this behaviour ? > > irb(main):017:0> 071.to_s > => "57" > irb(main):018:0> 71.to_s > => "71" > > Why is an octal Number converted to decimal when outputted as String ? Leave off the to_s: >> 071 => 57 You can represent your numbers in octal by putting a leading 0, but they will be accessed as decimal numbers throughout your application. If you want to display (any) number as octal, just use: >> 071.to_s(8) => "71" >> 57.to_s(8) => "71" -- Technical Blaag at: http://blog.majesticseacreature.com | Non-tech stuff at: http://metametta.blogspot.com