<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __to_float(val, digits):
 """Convert val into float with digits decimal."""

    try:
        return round(float(val), digits)
    except (ValueError, TypeError):
        return float(0)