import math


def human_float(value, significant=3, truncate_small=None, significant_zeros=False):
    """
    Return a string representing a float with human friendly significant digits.
    Switches to scientific notation for too large/small numbers.
    If `truncate_small`, then leading zeros of numbers < 1 are counted as 
    significant. If not `significant_zeros`, trailing unnecessary zeros are 
    stripped.
    """
    if value == 0:
        return "0"
    elif math.isinf(value) or math.isnan(value):
        return "{}".format(value)
    elif value < 0:
        sign = "-"
        value = -value
    else:
        sign = ""

    logv = math.log10(value)
    magnitude = int(math.floor(logv)) + 1

    if truncate_small is not None:
        magnitude = max(magnitude, -truncate_small + 1)

    num_digits = significant - magnitude

    if magnitude <= -5 or magnitude >= 9:
        # Too many digits, use scientific notation
        fmt = "{{0:.{0}e}}".format(significant)
    elif value == int(value):
        value = int(round(value, num_digits))
        fmt = "{0:d}"
    elif num_digits <= 0:
        value = int(round(value, num_digits))
        fmt = "{0:d}"
    else:
        fmt = "{{0:.{0}f}}".format(num_digits)

    formatted = sign + fmt.format(value)

    if not significant_zeros and '.' in formatted and 'e' not in fmt:
        formatted = formatted.rstrip('0')
        if formatted[-1] == '.':
            formatted = formatted[:-1]

    if significant_zeros and '.' not in formatted:
        if len(formatted) < significant:
            formatted += "." + "0"*(significant - len(formatted))

    return formatted