def __to_float(val, digits):
try:<EOL><INDENT>return round(float(val), digits)<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>return float(<NUM_LIT:0>)<EOL><DEDENT>
Convert val into float with digits decimal.