My Android app crashes during if statement and I can not find the mistake.
Here is a snippet of my code, how could I fix it?
public String formatResult(String inVal) {
String tmp = inVal.substring(inVal.length() - 2, inVal.length());
if (tmp.equals(".0") == true){
return inVal.substring(inVal.length(),inVal.length()-2);
} else {
return inVal;
}
}
== true,.equalsalready does that for you.