Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/01/2010, 04:29
jvbeltza
 
Fecha de Ingreso: enero-2010
Mensajes: 4
Antigüedad: 14 años, 3 meses
Puntos: 0
double String

TENGO UN GRAN PROBLEMA, y necesito ayuda. Tengo un fichero en excel, con numeroS de esta forma: -1,04 -0,6 ... etc y cuando los quiero utilizar como doubles me da esto:
java.lang.NumberFormatException: For input string: "-0,60"
at sun.misc.FloatingDecimal.readJavaFormatString(Unkn own Source)
at java.lang.Double.parseDouble(Unknown Source)
he pasado el fichero a texto, leo linea a linea, utilizo
StringTokenizer tokens=new StringTokenizer(linea);
str=tokens.nextToken();
str1=str.trim();
str1.replace(',', '.');
... y nada he utilizado DecimalFormat df = new DecimalFormat ("#,## 0,00 "); también NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH);
//nf.format(str1); Y NADA DE NADA
ES QUE JAVA NO PERMITE UTILIZAR ESTOS NÚMEROS,
por favor necesito ayuda estoy desesperado
Gracias