def delta_percent(decimals=1):
    """A formatter to display the float delta as a percentage with a given number of decimals.
    It's different from the percent formatter in that it's prefixed with a sign (+ or -).

    Args:
        decimals: The number of decimals to display.

    Returns:
        A formatter function f returning f(a), being variable 'a' displayed as a signed percentage.
        Please note the formatter function will multiply the float by 100 to get a percentage.

    """
    return lambda a: '{:+.{prec}f}%'.format(100.0 * a, prec=decimals)
