def filter_pad(val, width, fillchar=u'0'):
 return str(val).rjust(width, fillchar)

def filter_pad ( val , width , fillchar = u'0' ) : return str ( val ) . rjust ( width , fillchar )
pads a number or string with fillchar to the specified width .