How to convert string value into int? I am getting number format exception
.
String s = "20.00";
int i = (Integer.parseInt(s));
System.out.println(i);
Result should be like i=20
.
What about:
int i = (int) Double.parseDouble(s);
Of course, "20.00"
is not in a valid integer format.