Answer to Question #516 in C++ for bettyB

Question #516
How to output a floating point number with a specified number of decimal places into the stream?
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS