I converted a string to a double using ::atof, it converts OK but it rounds up the decimal and I don't want it to.
string n;
double p;
cout << "String? :" << endl;
cin >> n
p = ::atof(n.c_str());
cout << p << endl;
I usually type in numbers like 123,456.78, 12,345.87, 123,456,789.12. When I type in a smaller number like 1,234.83 or bigger the programs starts messing with the decimals.
It would be of huge help if anybody helps. Thanks!