Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: convert string to integer


Message #1 by "Brandon Ng" <nodnarb_33@y...> on Mon, 13 Aug 2001 19:41:11
int total=Integer.parseInt(price);
String stotal=(String)(total+total)

----- Original Message -----
From: "Brandon Ng" <nodnarb_33@y...>
To: "Pro_JavaServer_Pages" <pro_jsp@p...>
Sent: Monday, August 13, 2001 7:41 PM
Subject: [pro_jsp] convert string to integer


> how do i convert a string which i retrieve from database to int for
> mathematics calculation?
>
> String price = hoteldata.getString(1);
> String total = price + price;
>
> how do i change price into int so that i can calculate total?
> and what should the type cast be for total?
>
> 

  Return to Index