Commit d5523b08 authored by 耿迪迪's avatar 耿迪迪

燃气设备上报问题修改 gengdidi

parent 1c4a8bff
package com.zehong.gassdevicereport.utils;
import java.math.BigInteger;
public class HexUtils {
/**
* 字节转十六进制
......@@ -71,8 +73,10 @@ public class HexUtils {
* @return
*/
public static float hexToFloat(String hex){
Integer i = Integer.valueOf(hex.trim(), 16);
return Float.intBitsToFloat(i);
//Integer i = Integer.valueOf(hex.trim(), 16);
//return Float.intBitsToFloat(i);
return Float.intBitsToFloat(new BigInteger(hex.trim(), 16).intValue());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment