|
|
String to Integer problem
|
Posted: Jul 15, 2006 3:25 AM
|
|
|
Advertisement
|
Hi,
I'm new to JSP and I have problems converting String with decimal numbers to Integer.
I have a string with 8 decimals, it gets the vallue of a column in database. I would like to make a sum of all the rows. Example:
while (rs.next()) { String sumi = rs.getString("amountduration"); int sum = Integer.parseInt(sumi); // Code for making the sum // .. }
It appears that "Integer.parseInt" works only if the string doesn't have any decimals.
Thanks Zark
|
|