【C++FAQ】如何设定小数点后的显示位数

double avg = sum / 13;
cout.setf(ios::fixed);
cout.precision(4);
cout << "$" << sum / 12 << endl;

posted on 2011-06-24 15:37  speedmancs  阅读(684)  评论(0编辑  收藏  举报

导航