Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gass-device-report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gass-device-report
Commits
d5523b08
Commit
d5523b08
authored
Jan 07, 2022
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
燃气设备上报问题修改 gengdidi
parent
1c4a8bff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
HexUtils.java
...main/java/com/zehong/gassdevicereport/utils/HexUtils.java
+6
-2
No files found.
src/main/java/com/zehong/gassdevicereport/utils/HexUtils.java
View file @
d5523b08
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
());
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment