Is there a way that I can convert the following hexadecimal value into double:
String s = "16#1234#";
As converting this to long I am doing this
if (s.startsWith("16#" && s.endsWith("#")
{
extractedValue = s.substring( 3, s.length()-1 );
longValue = Long.parseLong( extractedValue, 16 );
}
Is there any way I can do the same and change the above to double. If I use
doubleValue = Double.parseDouble(s);
gives me an error so I want to parse the above value and change it to double any tips of work arround. Is there any way that I change the string to double with a specified radix as there are no such methods like parseLong or parseInt that also except readix.
Thanks
String s = "16#1234#";
As converting this to long I am doing this
if (s.startsWith("16#" && s.endsWith("#")
{
extractedValue = s.substring( 3, s.length()-1 );
longValue = Long.parseLong( extractedValue, 16 );
}
Is there any way I can do the same and change the above to double. If I use
doubleValue = Double.parseDouble(s);
gives me an error so I want to parse the above value and change it to double any tips of work arround. Is there any way that I change the string to double with a specified radix as there are no such methods like parseLong or parseInt that also except readix.
Thanks