Code:/* I am attempting to print out a float without a leading zero if it's a */ float number = .2 /* I thought just by specifying the following that this would take care of this: */ float val=.2; printf("val = [%7.1f]\n",val); /* However the output that I receive is: */ val = [ 0.2] /* As a work around I wrote the following code: */ char buffer[10]; float val=.2; char *dp; sprintf(buffer,"% 7.1f",val); dp = strchr(buffer,'.'); if( dp && !strncmp(dp-2," 0",2) ) *(dp-1)=' '; printf("val = [%s]\n",buffer); /* And I received the desired output of: */ val = [ .2] /* Is there an simpler way to do this imploring a format specifier that I am somehow overlooking? */