When writing this:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float number = 2.12345;
cout <<fixed <<setprecision(3) <<number;
return 0;
}
I get 2.123
If I then cout another float variable that I want all decimal numbers at, and not setprecision(3)...... How do I do that?
If I do something like setprecision(50) to get all decimals I will get more than the number is, for example 2.123 -> 2.123000000000000000000 etc.
Help =((