How can I display a float number = 0.999 as 0.99?
The code below keeps printing out 1.00 ? I thought using setprecision(2) specifies the number of digits after the decimal point?
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char** argv)
{
const float numberToDisplay = 0.999;
cout << setprecision(2) << fixed << numberToDisplay << endl;
return 0;
}