Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/03/2015, 13:12
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 8 meses
Puntos: 182
Respuesta: Number format exception

Buenas,

Seguramente tienes problemas con el locale que está utilizando.

Utiliza mejor esto para convertir el "2.0":

Código Java:
Ver original
  1. NumberFormat nf = NumberFormat.getInstance(Locale.US);
  2. float x = nf.parse(s).floatValue();


Un saludo
__________________
If to err is human, then programmers are the most human of us