Code:
float f = 0.1;
printf("%.1f\n", f);
result:
0.1
Is there a trick with format string to get
.1
printed instead?
Regard
Mi
I don't think you can do it just by changing the format string, as the
standard says "If a decimal-point character appears, at least one
digit appears before it.". Possibly it might help to print the string
to a buffer, using sprintf, and then inspect that before printing it.
Hope that helps.
Paul.