cout.precision(3);
cout << 2.3456764 << endl;

should out : 2.34.

keep in mind precision specifies the number of significant digits, not the number of decimal places.