Answer to Question #516 in C++ for bettyB
How to output a floating point number with a specified number of decimal places into the stream?
1
2010-07-28T11:09:24-0400
The easiest way is to use the manipulators. For example, std::setiosflags(std:: ios_base:: fixed), std::setprecision(2) sets 2 decimal places output.
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment