I need to change a string which is a 12 bit binary value into its decimal equivilant.
Any easy way?
Cheers in advance
Andy Dunn
Printable View
I need to change a string which is a 12 bit binary value into its decimal equivilant.
Any easy way?
Cheers in advance
Andy Dunn
Go back to your original question.
http://forums.vb-world.net/showthrea...threadid=15507
Stevie-O has the solution.
call it like this.
Code:MsgBox CvtBase("000000001111", 2, 10)
Hello Andy Dunn,
I think this is the most easiest way
Private Sub Command1_Click()
Answer = 0
For N = 0 To Len(Text1.Text) - 1
Answer = Answer + Mid(Text1.Text, (Len(Text1.Text) - N), 1) * 2 ^ N
Next
End Sub
Michelle.
I use this function to convert:
Function conv_bin_dec(bite) As Integer
Y = Len(bite) - 1
For x = 1 To Len(bite)
conv_bin_dec = conv_bin_dec + ((2 ^ Y)) * (Mid$(bite, x, 1))
Y = Y - 1
Next x
End Function