开发者

How to display a number of type Float64 upto one decimal place only

I have a variable , Float64 min; I want to display it only upto 1 place of decimal. Right now, I get 6 places if I use 开发者_C百科%f. How do I get only upto 1 place?


Use:

printf("%.1f", min);

See any reference such as this for details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜