def METHOD_NAME(value, variance):
    from numpy import floor, log10, power, round, sqrt
    # Treat 'infinite' precision the same as no variance
    if variance is None or variance == 0:
        return value, None, None
    # The uncertainty is the square root of the variance
    error = sqrt(variance)
    # Determine how many digits before (+) or after (-) the decimal place
    # the error allows for one-digit uncertainty of precision
    precision = floor(log10(error))
    # By convention, if the first digit of the error rounds to 1,
    # add an extra digit of precision, so there are two-digits of uncertainty
    if round(error * power(10.0, -precision)) == 1:
        precision -= 1
    # Build powers of ten to enable rounding to the specified precision
    negative_power = power(10.0, -precision)
    positive_power = power(10.0, precision)
    # Round the error, keeping the shifted value for the compact string
    error = int(round(error * negative_power))
    # Round the value, shifting back after rounding
    value = round(value * negative_power) * positive_power
    # If the precision is greater than that of 0.1
    if precision > -1:
        # pad the error to have the right number of trailing zeros
        error *= int(positive_power)
    return value, error, precision