Here's is an example:
std::cout << 1000000.0 << "\n";
std::cout << std::fixed << 1000000.0 << "\n";
std::cout << std::fixed << std::noshowpoint << 1000000.0 << "\n";
It will print me this:
1e+06
1000000.000000
1000000.000000
But I want this:
1000000
How I can do it with IO manipulators without setprecision()
?
Why without?
Because I want to print:
std::cout << 1000000.0 << " " << 1111111.1 << " " << 1234567.89;
and get:
1000000 1111111.1 1234567.89
without calculating precision for every number