data accuracy specification in C++

Hi all,

I'm wondering what's the equivalent for C++ for the following situation?

printf("%.3f\t", f_num);

I've never thought of it, thus have never dug into this... and I just need it right now...

anyone?

Thanks
cout << setprecision(3) << f_num << '\t';

http://cplusplus.com/reference/iostream/manipulators/
Topic archived. No new replies allowed.