I have a problem in java and I would greatly appreciate your help.
I am developing a project in which we are working with several colleagues, we also use functionality that comes from outside. The fact is that I have to make the step from String to Integer.
Ilustro with the method used for the conversion;
private int parseoint(String aux) {
aux.replaceAll(" ", "");
int numEntero = Integer.parseInt(aux);
return numEntero;
}
And this one used to narrow the String to convert;
if (matChu.find()) {
this.chunk = matChu.group(1);
this.chunk_parsed = parseoint(this.chunk);
} //....Aqui el codigo sigue
With the first we convert what we get out of the second. The problem is that this is the result obtained;
Exception in thread "Thread-1" Exception in thread "Thread-2" > queryjava.lang.NumberFormatException: For input string: "1.0"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
The debugger and others have been used, but now it has been a couple of days without finding the error. A cordial greeting and thanks for your time.