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

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/
=> []

ri sprintf

Search for ‘hex’.

(x and X)

marcel

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 [email protected] wrote:

Regards, Daniel


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