def printnum(num, total=6, after=2):
    """prints a number with after digits after the decimal point and
    taking up total spaces. Padded on the front if need be"""
    formstr = "%." + str(after) + "f"
    new = formstr % num
    return (total - len(new)) * ' ' + new