C++ unfortunately makes formatting a clumsy affair. In C++ a programmer uses tiny objects called manipulators to change the way the stream behaves. You can find the manipulators that C++ has standard in any reference page: C++ I/O Flags [C++ Reference]. It is important that you become familiar with these.
You can also make your own manipulators.
It seems what you want is:
for all floating point numbers foobar.
cout << showpoint << setprecision(2) << foobar;
It is also nice to remove the format after you are done:
Forgetting to do that can make output look strange sometimes when you don't expect it.
cout.resetiosflags( ios_base::showpoint );