James Gray
10/1/2004 11:09:00 PM
On Oct 1, 2004, at 5:14 PM, GGarramuno wrote:
> I was wondering if there was a method in ruby to obtain the hexadecimal
> representation of numbers (ie. fixnum, floats, mainly) in either msb
> or in lsb
> order.
> Basically, I'm kind of looking for the opposite function of
> String#unpack().
I'm not 100% sure I understood the question, but does this do what
you're after?
% ruby -e 'puts "%x" % 123'
7b
Hope that helps.
James Edward Gray II