1
I need Java to convert a String
which has a binary value (Ex: "0111010") for a double
. I tested:
String teste = "101010101";
double number = Double.parseDouble(teste);
System.out.println("The number is: " + number);
But the output is a completely different hexadecimal number. I need the output to be the same as the String
. The double
can even put point somewhere, no problem, but need to keep the same binary and in the same order.
Of course, important detail that I didn’t remember. That’s it! Thank you.
– Developer1903
I made no attempt to turn the
String
indouble
because that number would be invalid. If it were for an integer it would give and has function ready for it. It also has todouble
, but the text needs to be in format that can be converted correctly.– Maniero