Preserved Topic: Converting types in Java (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
posted 04-27-2001 03:16
Yea, it's me again. I need to know if there is a way to convert a piece of a string, to a double. The program I have to write requires that the user input a temperature, but it has to end with a letter (i.e. 98.6F or 32C). Because of the letter ending I read the input from the keyboard as a string and not a double. Now I want to convert the number part of the string to a double, but I don't seem to be able to. I tried : |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 04-27-2001 05:50
double x = Double.parseDouble(String); |