I want to get the result 0.054563
from a String
and parse it as a double
. My current attempt looks like,
String number1 = "54,563";
String number2 = "54,563";
String value = "0.0" + number1;
String value2 = "0.0" + number2;
Double rd1 = Double.parseDouble(value.replaceAll(",","."));
Double rd3 = Double.parseDouble(value2.replaceAll(",","."));
System.out.println(rd1);
However, when I run it, I get the following error:
Exception in thread "main" java.lang.NumberFormatException: multiple points