def _trim_zeros_float(str_floats, na_rep='<STR_LIT>'):
trimmed = str_floats<EOL>def _is_number(x):<EOL><INDENT>return (x != na_rep and not x.endswith('<STR_LIT>'))<EOL><DEDENT>def _cond(values):<EOL><INDENT>finite = [x for x in values if _is_number(x)]<EOL>return (len(finite) > <NUM_LIT:0> and all(x.endswith('<STR_LIT:0>') for x in finite) and<EOL>not (any(('<STR_LIT:e>' in x) or ('<STR_LIT:E>' in x) for x in finite)))<EOL><DEDENT>while _cond(trimmed):<EOL><INDENT>trimmed = [x[:-<NUM_LIT:1>] if _is_number(x) else x for x in trimmed]<EOL><DEDENT>return [x + "<STR_LIT:0>" if x.endswith('<STR_LIT:.>') and _is_number(x) else x<EOL>for x in trimmed]<EOL>
Trims zeros, leaving just one before the decimal points if need be.