def infer_precision(number):
    """
    Infer precision base on number size.

    >>> infer_precision(0.343)
    3
    >>> infer_precision(0.0001343)
    5
    >>> infer_precision(12300)
    0

    :param float number: number used to infer precision.
    :return int: precision as int (number of decimals recommended)
    """
    number = number or 0.0
    try:
        number = float(number)
    except ValueError:
        return number
    if number is not None and isinstance(number, float):
        if number < 1e-06:
            return 10
        elif number < 0.0001:
            return 8
        elif number < 0.01:
            return 5
        elif number < 1.0:
            return 3
        elif number < 100.0:
            return 2
        elif number < 1000.0:
            return 1
        else:
            return 0
