P
Pedro Pinto
Hi there,
I'm having some dificulties in converting from string to float. I get
a number format exception... This is suposed to be easy but i can't
seem to figure it out, can someone give me some help?
Here's the code:
String cde = "1,685";
float num = Float.valueOf(cde).floatValue();
Exception:
Exception in thread "main" java.lang.NumberFormatException: For input
string: "1,685"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.valueOf(Unknown Source)
at Ascii.main(Ascii.java:8)
Thanks in advance for any help!
Regards
Pedro Pinto
I'm having some dificulties in converting from string to float. I get
a number format exception... This is suposed to be easy but i can't
seem to figure it out, can someone give me some help?
Here's the code:
String cde = "1,685";
float num = Float.valueOf(cde).floatValue();
Exception:
Exception in thread "main" java.lang.NumberFormatException: For input
string: "1,685"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.valueOf(Unknown Source)
at Ascii.main(Ascii.java:8)
Thanks in advance for any help!
Regards
Pedro Pinto