hex to dec and dec to hex

2003-06-11 Thread Ken Lehman
Is there an easy way to go back and forth between decimal and hex in perl.
I know of the hex function which solves my hex to dec problem but how about
a dec->hex function or module? I need the value which is why printf isn't
working for me.
Thanks for any help.
-Ken



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: hex to dec and dec to hex

2003-06-11 Thread Charles K. Clarkson
Ken Lehman [mailto:[EMAIL PROTECTED] 
: 
: Is there an easy way to go back and forth between
: decimal and hex in perl. I know of the hex function
: which solves my hex to dec problem but how about a
: dec->hex function or module? I need the value which
: is why printf isn't working for me.

Are you aware of 'sprintf'?

my $decimal_value = 10;
my $hex_value = sprintf '%x', $decimal_value;


HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]