I have following code:
int main(void)
{
printf("%.3lf\n ",-2158470*0.001);
}
it prints
-2158.470
How can i disable '0' at the end, if they are not needed ?
Is there a possibility just to write %lf and just print as many digits
as needed to represent the number ?
int main(void)
{
printf("%.3lf\n ",-2158470*0.001);
}
it prints
-2158.470
How can i disable '0' at the end, if they are not needed ?
Is there a possibility just to write %lf and just print as many digits
as needed to represent the number ?
Comment