Conversion of signed digit to 8 digit hexadecimal in vb6

albertleng
02-16-2008, 01:23 AM
Hi all,

i need to write a program which convert a signed digit to a 8 digit
hexadecimal.
If given a decimal number 100, i need to convert to hexadecimal as
00000064.
How can i set the hexadecimal output to 8-digit?


Thanks.

Rockoon
02-16-2008, 02:30 AM
right$(string$(8, "0") & hex$(value), 8)

albertleng
02-17-2008, 08:56 PM
Thanks. It works for me.
Now, how about the other way from from a 8-digit Hexadecimal to a signed decimal number with 1 decimal point. For example,

i) "00000020" will be converted to 3.2

ii) "00000011" will be converted to 1.7

OnErr0r
02-17-2008, 09:22 PM
Dim dbl As Double

dbl = CLng(sHex) / 10

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum