I take in a double
and divide it by 1000, then output it to 5 decimal places. However, rounding occurs and I'm not sure how to make sure it doesn't.
double dbl1;
cout << "Enter: ";
cin >> dbl1;
dbl1 = dbl1 / 1000;
cout << "Out: " << fixed << setprecision(5) << dbl1;
Input: 1.24768.
Expected: 0.00124.
Output: 0.00125.