HPE 9000 and HPE e3000 Servers
cancel
Showing results for
Did you mean:

SOLVED
Go to solution

## convert from hex to decimal

Hi,
Can someone please show me the way to convert numbers from hex to decimal and from decimal to hex on 11.23 ( PA-Risc & Itanum ) ?

in 11.11 i used the :

to convert from base to base.

Thanks

Reuven
Reuven
4 REPLIES 4
Honored Contributor

## Re: convert from hex to decimal

Hi Reuven,

This is fairly simple with bc - as follows:

#bc
obase=10
ibase=16
F
15
quit
#

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Honored Contributor
Solution

## Re: convert from hex to decimal

Reuven

Decimal to hex:
printf "%x\n" 15
f

Hex to Decimal:
printf "%d\n" 0xf
15

## Re: convert from hex to decimal

Eventhough I used the way like I presented in my question with adb, Peter Gordon gave me a good sloution and that what counts.

thak you all,
Reuven
Reuven
Acclaimed Contributor

## Re: convert from hex to decimal

You can also use the shell to do simple conversions:
typeset -i16 x=10#25; echo \$x