I am reading some numbers including commas as thousands separator from a text-file, that is numbers on the form -1,234.56
My question now is how I convert a number on this form into a double?
If the number didn't contain commas as thousands separator I could just use Doble.parseDouble(String), and of course I can have comma removed using Double.parseDouble(String.replaceAll(",","")). However I am looking for a more general solution using some kind of formatter. How can I do that?