I have this code:
public void refreshResources(){
try{
String res = driver.findElement(By.cssSelector("#resources_metal")).getText();
System.out.println("Metal read: " + res);
res = res.replaceAll("\\u002e", ""); //Removes dots
System.out.println("Metal without dots: " + res);
this.metRes = Double.parseDouble(res);
System.out.println("Converted Metal: " + metRes);
}catch(NoSuchElementException error){
System.out.println("Error please try again");
}
This is my output:
Metal read: 47.386.578
Metal without dots: 47386578
Converted Metal: 4.7386578E7
the question is, why do I have that "E7" at the end of my converted metal? Thanks in advance.