public string FloatToHex(float floatValue)
{
uint uintValue = BitConverter.ToUInt32(BitConverter.GetBytes(floatValue), 0);
byte[] byteValue = BitConverter.GetBytes(uintValue);
Array.Reverse(byteValue);
return BitConverter.ToString(byteValue).Replace("-","");
}
public float HexToFloat(String hexString)
{
uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
byte[] floatVals = BitConverter.GetBytes(num);
return BitConverter.ToSingle(floatVals, 0);
}
{
uint uintValue = BitConverter.ToUInt32(BitConverter.GetBytes(floatValue), 0);
byte[] byteValue = BitConverter.GetBytes(uintValue);
Array.Reverse(byteValue);
return BitConverter.ToString(byteValue).Replace("-","");
}
public float HexToFloat(String hexString)
{
uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
byte[] floatVals = BitConverter.GetBytes(num);
return BitConverter.ToSingle(floatVals, 0);
}