From: Fer# Date: 2007-01-28T09:15:07+09:00 Subject: Re: Question about digits Why call them digits, if you can call them characters? If you have got arbitrary_number, you got arbitrary_number.to_s so: ---- irb(main):001:0> arbitrary_number=123 => 123 irb(main):002:0> arbitrary_number.to_s => "123" irb(main):002:0> arbitrary_number.to_s.length => 3 irb(main):003:0> (0...arbitrary_number.to_s.length).map{|digit| arbitrary_number.to_s.split('')[digit]} => ["1","2","3"] ---- This above will do for base 10, and printf stuff may help with hex, oct at least. Remember it is '...' and not '..' so you don't access arbitrary_number[arbitrary_number.length] Hope this may help you