How can I fix the level of precision? for example, I want 2 digits after decimal point for each element.
The function .precision actually controls the total length of data, which is not what I want.
Thanks in advance!
Thanks for the reply. It works! But there is something I want to understand:
It seems that when I put once the << std::fixed << std::setprecision(2); all code after will follow the format. How can I make it work only for a block of code, not all of the rest of the code following the function?