string line2 = "-89.75131467880756";
cout<<line2<<" <> ";
xcord = atof(line2.c_str());
cout<<xcord<<endl;
output -
-89.75131467880756 <> -89.7513
Question is ... how do i get it to desplay more precision.
Printable View
string line2 = "-89.75131467880756";
cout<<line2<<" <> ";
xcord = atof(line2.c_str());
cout<<xcord<<endl;
output -
-89.75131467880756 <> -89.7513
Question is ... how do i get it to desplay more precision.
This should do it:
Code:#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main (void)
{
double xcord;
string line2 = "-89.75131467880756";
cout<<line2<<" <> ";
xcord = atof(line2.c_str());
cout<<setprecision(16) << xcord<<endl;
return 0;
}
Such a simple fix..... Thank you sooooo much =)