From: Dave Thomas Date: 2003-07-03T00:26:37+09:00 Subject: Re: Base of Numbers Volker Grabsch wrote: >>.. anything except printf that allows me to change the >>base of a number? >> >> dave[ruby/mac 10:26:07] ri Fixnum.to_s This is a test 'ri'. Please report errors and omissions on http://www.rubygarden.org/ruby?RIOnePointEight ------------------------------------------------------------ Fixnum#to_s fix.to_s( base=10 ) -> aString ------------------------------------------------------------------------ Returns a string containing the representation of fix radix base (2, 8, 10, or 16). 12345.to_s #=> "12345" 12345.to_s(2) #=> "11000000111001" 12345.to_s(8) #=> "30071" 12345.to_s(10) #=> "12345" 12345.to_s(16) #=> "3039"