parsing - setting locale for each variable in java -


hello ive got problem program. try reading lines file ,split them each variable. file have different types of double like:

  • 10000,20
  • 4000,10
  • 5,400.20

and when trying parse strings double ive got exception:

java.lang.numberformatexception: input string: "10000,20" @ sun.misc.floatingdecimal.readjavaformatstring(unknown source) @ sun.misc.floatingdecimal.parsedouble(unknown source) @ java.lang.double.parsedouble(unknown source) 

problem comma(,) in "10000,20" remove comma , try

 double.parsedouble("10000,20".replace(",", "")) 

Comments