i must divide the results of two strings in Java. I hava tried valueOF, parseUnsignedInt and other methods, but the problem is, that for the first string they does not work. The strings are getText()
results from a certain web element, which i am getting using Selenium
. Here is my code
System.out.println( Integer.valueOf(st) /Integer.parseUnsignedInt( element.getAttribute("innerHTML").substring(16) ));
Here is error which i have
Exception in thread "main" java.lang.NumberFormatException: For input string: "10,768"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.valueOf(Integer.java:983)
at com.company.Main.main(Main.java:64)
10768
is the string number for my String st
How can I handle this situation to get the division number correctly?