Following is resulting in an Exception
:
String p=\"1,234\";
Double d=Double.valueOf(p);
System.out.println(d);
Is there a bet
You can use this (the French locale has ,
for decimal separator)
NumberFormat nf = NumberFormat.getInstance(Locale.FRANCE);
nf.parse(p);
Or you can use java.text.DecimalFormat and set the appropriate symbols:
DecimalFormat df = new DecimalFormat();
DecimalFormatSymbols symbols = new DecimalFormatSymbols();
symbols.setDecimalSeparator(',');
symbols.setGroupingSeparator(' ');
df.setDecimalFormatSymbols(symbols);
df.parse(p);