-6
[65,98]09-19 15:26:29.452 19498-19498/co.helpdesk.faveo.pro W/System.err: java.lang.NumberFormatException: For input string: "65,98"
09-19 15:26:29.453 19498-19498/co.helpdesk.faveo.pro W/System.err:     at java.lang.Integer.parseInt(Integer.java:521)
09-19 15:26:29.453 19498-19498/co.helpdesk.faveo.pro W/System.err:     at java.lang.Integer.parseInt(Integer.java:556)

can anyone tell me how to convert this into an integer? I am getting this as 65,98 but it is telling me number format exception,

Please tell me how to solve this problem.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

1

Parse the string into int. You can use split method as from documentation to parse each value separated by comma.

if(!yourData.isEmpty()){
    String[] result = yourData.split(",");
    int varOne = Integer.parseInt(result[0]);
    int varTwo = Integer.parseInt(result[1]);
}
Satan Pandeya
  • 3,747
  • 4
  • 27
  • 53