Much more versatile formatting can be done using the printf and sprintf commands. Use printf when you want to send output to standard out. Use sprintf when you want to create a string and store it in a variable. Other than those differences, the command format for both are identical. Parentheses are optional, but recommended.
Fields are right-justified by default.
For strings, you would use the width parameter. Always remember that the width of a floating-point field includes all digits, signs, and decimal points. The awk system variable OFMT can be modified to change this default value.