
January 30th, 2013, 01:43 PM
|
 |
Contributing User
|
|
Join Date: May 2004
Location: Superior, CO, USA
|
|
Building on the code you have you'd want to do something like:
java Code:
Original
- java Code |
|
|
|
int n = s1.indexOf(":"); if( n > -1 ) firstPart = s1.substring( 0, n ); if( firstPart != null ) double result = Double. parseDouble(firstPart );
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.
|