Hi zshukralla,
sprintf is very much like printf, except where printf prints to the screen by default, the output of sprintf is returned as a string.
Example:
formatstring=sprintf("This is a %s string","formatted"

;
print "formatstring\n";
The output will be: 'This is a formatted string'
The format specifiers for sprintf are the exact same as for printf.
To get a left justification, use the minus (-) modifier.
To get fixed spacing, use a numeric modifier.
Example:
#!/usr/bin/awk -f
BEGIN{
formatstring=sprintf("%5d, %-10d, %s",12345,67890,"Red"

;
print formatstring;
exit;
}
% test
12345, 67890 , Red
For more info, search for sprintf on this site, or check any awk manual for printf or sprintf. If you don't have an awk manual, check a C manual or a perl manual. The syntax is pretty much identical.
Good luck,
Grant.
(Hope you get an 'A').