Click here to Skip to main content
15,905,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to convert a hexstring to a float value. For eg. 00E1 should be displayed as 0.225... i.e 00E1 converted to decimal and its been divided by 1000. Please help what is the required query.
Posted

 
Share this answer
 
Here a breakdown of what you need:
Java
String hexValue = "00E1";
int intValue = Integer.parseInt(hexValue , 16);
float floatValue = intValue / 1000.0f;

Good luck!
 
Share this answer
 
v2
Comments
CPallini 29-May-15 3:42am    
5.
User1454 29-May-15 4:56am    
Thanks u so much..... Works like a charm !!!!! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900