The width specifier is the complete width:
printf("%05.1f\n", myVar); // Total width 5, pad with 0, one digit after .
To get your expected format:
printf("% 06.1f\n", myVar);
The width specifier is the complete width:
printf("%05.1f\n", myVar); // Total width 5, pad with 0, one digit after .
To get your expected format:
printf("% 06.1f\n", myVar);