I have a string variable and want to convert it into double without any scientific notation. I tried using std::stod but that doesn't work.
std::stringstream timestamp;
timestamp << t_val;
string test = timestamp.str();
cout << test << endl; // this gives 1506836639.96
double d = std::stod(test);
cout << d << endl; // This gives 1.50684e+09 instead of 1506836639.96
I tried using setprecision and fixed but I couldn't store the result into a variable. Is there a way I can store the value of test (1506836639.96) as a double?