import math


def pickLabelFormat(increment):
    """Pick an appropriate label format for the given increment.
    
    Examples:
    >>> print pickLabelFormat(1)
    %.0f
    >>> print pickLabelFormat(20)
    %.0f
    >>> print pickLabelFormat(.2)
    %.1f
    >>> print pickLabelFormat(.01)
    %.2f
    """

    i_log = math.log10(increment)
    if i_log < 0 :
        i_log = abs(i_log)
        decimal_places = int(i_log)
        if i_log != decimal_places :
            decimal_places += 1
    else :
        decimal_places = 0
        
    return "%%.%df" % decimal_places