求大神解答,怎样去除小数后面的零
codeblocks吧
全部回复
仅看楼主
level 1
向前跑hx
楼主
2015年08月19日 01点08分
1
level 1
杀道独行
楼主试试像这样输出打印 printf_s("%.2f",number); 这样就输出小数点后面2位了
2015年08月19日 06点08分
2
level 1
dominghao
c++的话 用 setprecision()与showpoint()。
原文
http://blog.csdn.net/u011321546/article/details/9293547
2015年08月21日 02点08分
3
level 12
贴吧用户_QJeA4NP
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(0);
在输出之前加
2015年08月22日 09点08分
4
1