I also tried recovered recovered.toString().getBytes() and I got: [enter image description here][2]
How can I have int or long value of "889.0"?
Thank you.
[1]: https://i.sstatic.net/GF3tD.jpg
[2]: https://i.sstatic.net/TXNBb.jpg
The string "889.0"
is not a valid format to convert to a Long
or an Integer
, it is a decimal format and you could convert it to a Float
or a Double
.
If you want an integer you could convert it to a float first and then use Float.intValue
to convert it to an integer.
Float f = Float.valueOf(recovered.toString();
Integer i = f.intValue();