def align_decimal(number, left_pad=7, precision=2):
    """Format a number in a way that will align decimal points."""
outer = '{0:>%i}.{1:<%i}' % (left_pad, precision)
inner = '{:.%if}' % (precision,)
return outer.format(*inner.format(number).split('.'))
Using Python's Format Specification Mini-Language to align floats