#include <iostream>
#include <iomanip>
#include <iostream>
int main()
{
double d = 122.345;
cout << fixed << setprecision(2) << d;
//the setprecision can vary as per required
}
#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
cout << fixed << setprecision(n)<<variable; //n is number of places needed after decimal point
#include <cstdio>
#include <iostream>
int main() {
double total;
cin>>total;
printf("%.2f
", total);
//one can use the C function to print the decimal points
}