converting a double to a string

hi i think i need to convert a double to a string, we are working in visual studio doing a program. when i run the calculator i'm not getting the answer i need instead its giving me 0.0 when it should be reading 0.5, here is the code i'm using

{
int width;
int height;
int area;
double gop;

String ^strWidth;
String ^strHeight;
String ^strArea;
String ^strGop;
strWidth=width1->Text;
strHeight=height1->Text;
strGop=ansr2->Text;
width=Int32::Parse(strWidth);
height=Int32::Parse(strHeight);
area=height*width;
strArea=area.ToString();
ansr1->Text=strArea;
gop=area/400;
strGop=gop.ToString("0.0");
ansr2->Text=strGop;

}
never mind i figured it out that quick, i had area as int and i was dividing area by gop. i simply changed area to double and i now get the correct answer
Topic archived. No new replies allowed.