"Piotr B." wrote:
>
> 1. How to strip trailing zeroes from float values?
> printf("%f %f", 1.777, 1.2) displays "1.777000 1.200000",
> while I want to have "1.777 1.2", without loosing 6-digit
> precision.
printf("%.3f %.2f", 1.777, 1.2);
Read the standard. Don't cross post between c.l.c and c.l.c++;
they are different languages. Follow-ups set. c.l.c++ probably
won't use printf anyhow.
--
"I support the Red Sox and any team that beats the Yankees"
"Any baby snookums can be a Yankee fan, it takes real moral
fiber to be a Red Sox fan"
"I listened to Toronto come back from 3:0 in '42, I plan to
watch Boston come back from 3:0 in 04"
|