Wednesday, January 2, 2008

Converting Integers to Hexadecimal in Ruby

Lots of info out there on how to go the other way. It's quite easy:

my_integer.to_s(base=16)

Substitute different values for whatever base you want (i.e. 2 for binary).

0 comments: