Sub Activity_Create(FirstTime As Boolean)
Log(ParseHexToFloat("C4C6728F"))
End Sub
Sub ParseHexToFloat(hex As String) As Float
Dim bc As ByteConverter
Return bc.FloatsFromBytes(bc.HexToBytes(hex))(0)
End Sub
thx! for all Erel
Now I will like to do the opposite (float to hex), but it does not work
I use the same as you metode
I did not find other example on the forum
B4X:
Sub Activity_Create(FirstTime As Boolean)
Log(FloatToHex(-1258.25))
End Sub
Sub FloatToHex(Fl As Float) As String
Dim bc As ByteConverter
Return bc.HexFromBytes(bc.FloatsToBytes(Fl)(0))
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.