Is there a way to automatically printf a float to the number of decimal places it has?

前端 未结 0 1181
既然无缘
既然无缘 2021-02-04 11:05

I\'ve written a program to display floats to the appropriate number of decimal places:

#include 
int main()
{
printf("%.2f, %.10f, %.5f, %.5f\         


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