Organizational Research By

Surprising Reserch Topic

what is the best way to parsedouble with comma as decimal separator


best way to parsedouble with comma as decimal separator  using -'java'

Following is resulting in an Exception:

String p="1,234";
Double d=Double.valueOf(p);
System.out.println(d);


Is there a better way to parse "1,234" to get 1.234 than: p = p.replaceAll(",",".");?
    

asked Sep 16, 2015 by mannumits1
0 votes
10 views



Related Hot Questions

5 Answers

0 votes
NULL
answered Sep 16, 2015 by deepak07.s
0 votes
NULL
answered Sep 16, 2015 by sumit_jaiswalmca
0 votes
NULL
answered Sep 16, 2015 by mca.agarwal
0 votes
NULL
answered Sep 16, 2015 by loknath.ganji
0 votes
NULL
answered Sep 16, 2015 by sameer rathore

...