1.字符串类型浮点数转float类型

 string strNumber = "71.068";
 float floatNumber =float.Parse(strNumber); //输出floatNumber =71.068

2.浮点数转4个字节(float类型),double默认转8个字节

  float floatNumber = 71.068f;
  byte[] result = BitConverter.GetBytes(floatNumber);//float浮点数默认转为4个字节,double默认转8个字节
  Array.Reverse(result); //数组元素翻转
11-16 09:07