i have created a sub routine to convert binary to decimal:
B4X:
Sub binTodec(binVal As String) As Int
Dim i As Int, v As Int, dec As Int
i = binVal.Length
v = 1
For pos = i To 1 Step -1
If binVal.SubString2(pos-1, pos) = "1" Then dec = dec + v
v = v * 2
Next
Return dec
End Sub
Armoured,
Did you test the above sub? in my machine it is saying nonconvertible type.
didn't touch your code, but tried to put the returned string in an edittext.
Thanks in advance for more light on this.
Armoured,
Did you test the above sub? in my machine it is saying nonconvertible type.
didn't touch your code, but tried to put the returned string in an edittext.
Thanks in advance for more light on this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.