cout float without trailing zeros and with only 3 digits after the

后端 未结 0 630
渐次进展
渐次进展 2021-01-19 05:59

I\'m trying to print a float variable, I want it to have only 3 digits after . but if if they are zeros not to print them

for example

1.230 -> shoul         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题