def forgiving_round(value, precision=0, method='common'):
    'Round accepted strings.'
    try:
        multiplier = float((10 ** precision))
        if (method == 'ceil'):
            value = (math.ceil((float(value) * multiplier)) / multiplier)
        elif (method == 'floor'):
            value = (math.floor((float(value) * multiplier)) / multiplier)
        elif (method == 'half'):
            value = (round((float(value) * 2)) / 2)
        else:
            value = round(float(value), precision)
        return (int(value) if (precision == 0) else value)
    except (ValueError, TypeError):
        return value
Round accepted strings.
def forgiving_round(value, precision=0, method='common'):
    
    try:
        multiplier = float((10 ** precision))
        if (method == 'ceil'):
            value = (math.ceil((float(value) * multiplier)) / multiplier)
        elif (method == 'floor'):
            value = (math.floor((float(value) * multiplier)) / multiplier)
        elif (method == 'half'):
            value = (round((float(value) * 2)) / 2)
        else:
            value = round(float(value), precision)
        return (int(value) if (precision == 0) else value)
    except (ValueError, TypeError):
        return value