im trying to convert double to string with this code:
if its a number like 3.7345 than its working - but if its 5.0
(only zeros after the point)
double number=5.0;
string ToString;
stringstream out;
out << number;
ToString = out.str();
return ToString;
it returns - 5
and i need it to return - 5.0
--------------------------------------
i realized that if ill do
double number=5.0;
cout<<nubmer;
im getting the number 5 insted of the number 5.0
how do i make the variable hold the zeros after the floating point and show them?
hope both my questions make sense :)
ill apriciate any answer given !