import math


def compute_digit_number(value):
    """
    return int, number of digits to display

    Parameters
    ----------
    value : float
        can be the gap between percentiles

    Returns
    -------
    int
        number of digits
    """
    # fix for 0 value
    if(value == 0):
        first_nz = 1
    else:
        first_nz = int(math.log10(abs(value)))
    digit = abs(min(3, first_nz) - 3)
    return digit