|
-
August 4th, 2009, 02:57 PM
#1
Parsing a double from a string
Hi,
I was trying to pass a string into a double myself, but I get thrown a Numberformat exception.
Here's what I am trying to do:
String s = Litres of water collected are 12.5
I want to parse only the numeric value "12.5" into a double. I tried Double.valueOf(s); as well as Double.parseDouble(s); But they don't seem to work. Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|