How do I pad a printf to take account of negative signs and variable length numbers?
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);