You could add std::fixed
like so:
float f;
std::cin >> f;
std::cout << std::setw(10) << std::right << std::fixed << std::setprecision(3) << f << "\n";
1
solved Float formatting C++
You could add std::fixed
like so:
float f;
std::cin >> f;
std::cout << std::setw(10) << std::right << std::fixed << std::setprecision(3) << f << "\n";
1
solved Float formatting C++