|
-
August 9th, 1999, 01:09 PM
#1
Problem with Converting a Hex to Double
Hi,
I am having problem converting the hex string into double using CDbl function. I am trying to convert this string "ff90e5ed" but Cdbl returns this -7281171. It is really straight forward. I really dont know what is wrong with it. If any of U know mail me how to solve this.
-
August 10th, 1999, 02:55 AM
#2
Re: Problem with Converting a Hex to Double
this code gives you the correct result.
private Sub Command1_Click()
MsgBox cvt("&Hff90e5ed")
End Sub
private Function cvt(byval strHex as string) as Double
Dim i as Integer
Dim result as Double
Dim j as Integer
for i = len(strHex) to 3 step -1
result = result + CInt("&H" & mid(strHex, i, 1)) * 16 ^ j
j = j + 1
next i
cvt = result
End Function
-
August 17th, 1999, 01:54 PM
#3
Re: Problem with Converting a Hex to Double
Thanks a Lot I wrote a similar function to do that. But why is that problem?
Thanks for the reply.
Srini
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|