def delta_value(decimals=1, unit='$'):
    """A delta formatter to display the delta as a float with a given unit.

    Args:
        decimals: The number of decimals to display.
        unit: The unit symbol to display after the delta value.

    Returns:
        A delta formatter function (f(a,b)) returning (b-a)/a accompanied with a unit.

    """
    return lambda a, b: '{:+,.{prec}f} {unit}'.format(1.0 * (b - a), unit=
        unit, prec=decimals)
