title: Byte Array to Float Conversion C#
body: <p>I have tried the below C# code to convert from <strong>hex literal to floating point</strong> and get the correct result. I wish to <strong>input a byte array instead and have that converted to floating point</strong> but can't seem to get it right result.</p>
  
  <p><code>0x4229ec00</code> is the current format. I need it in <code>byte array</code> format something like...</p>
  
  <pre><code>new byte[]{ 0x01, 0x04, 0x01, 0x60, 0x00, 0x02, 0x70, 0x29}; //current output 42.48
  </code></pre>
  
  <p>The code looks like:</p>
  
  <pre><code>byte[] bytes = BitConverter.GetBytes(0x4229ec00);
  float myFloat = floatConversion(bytes);
  
  public float floatConversion(byte[] bytes)
  {
      float myFloat = BitConverter.ToSingle(bytes, 0);
      return myFloat;
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thank you!</p>