Decimal points with std::stringstream?
I think that your problem is that precision() sets the precision used in future stream insertion operations, not when generating the final string to present. That is, by writing ta << a; tb << b; tc << c; ta.precision(2); tb.precision(2); tc.precision(2); You’re setting precision too late, as the first three lines have already converted the … Read more