std::cout << std::setprecision(2) << std::fixed; // where the 2 is how many decimal places you want // note you need to <iomanip>