#include <iostream>
#include <iomanip>
int main()
{
double d = 122.345;
std::cout << std::fixed;
std::cout << std::setprecision(2);
std::cout << d;
}
//use #include<iomanip>
cout<<"Result = "<<fixed<<setprecision(3)<<result;//like Result = 2.434
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
value = 3.15647;
std::cout << std::fixed << std::setprecision(2);
std::cout<<value<<std::endl;
return 0;
}