10.to_hex?

Hello,

I can't find the function to convert an number to its hex representation
I feel it must be there ..

irb(main):068:0> Integer.methods.grep /hex/
=> []
irb(main):069:0> Numeric.methods.grep /hex/
=> []

Regards, Daniel

ri sprintf

Search for 'hex'.

(x and X)

marcel

···

On Sat, Nov 19, 2005 at 11:32:25AM +0900, Daniel Sch?le wrote:

Hello,

I can't find the function to convert an number to its hex representation
I feel it must be there ..

irb(main):068:0> Integer.methods.grep /hex/
=>
irb(main):069:0> Numeric.methods.grep /hex/
=>

--
Marcel Molina Jr. <marcel@vernix.org>

10.to_s(16) #=> a

class Numeric
   def to_hex
      to_s(16)
   end
end

10.to_hex #=> a

···

On 11/18/05, Daniel Schüle <uval@rz.uni-karlsruhe.de> wrote:

Hello,

I can't find the function to convert an number to its hex representation
I feel it must be there ..

irb(main):068:0> Integer.methods.grep /hex/
=>
irb(main):069:0> Numeric.methods.grep /hex/
=>

Regards, Daniel

--
Tobi
http://jadedpixel.com - modern e-commerce software
http://typo.leetsoft.com - Open source weblog engine
http://blog.leetsoft.com - Technical weblog

harp:~ > ruby -e' p("%x" % 66) '
"42"

-a

···

On Sat, 19 Nov 2005, [ISO-8859-1] Daniel Schüle wrote:

Hello,

I can't find the function to convert an number to its hex representation
I feel it must be there ..

irb(main):068:0> Integer.methods.grep /hex/
=>
irb(main):069:0> Numeric.methods.grep /hex/
=>

Regards, Daniel

--

ara [dot] t [dot] howard [at] gmail [dot] com
all happiness comes from the desire for others to be happy. all misery
comes from the desire for oneself to be happy.
-- bodhicaryavatara

===============================================================================