def _round_frac(x, precision):
if not np.isfinite(x) or x == <NUM_LIT:0>:<EOL><INDENT>return x<EOL><DEDENT>else:<EOL><INDENT>frac, whole = np.modf(x)<EOL>if whole == <NUM_LIT:0>:<EOL><INDENT>digits = -int(np.floor(np.log10(abs(frac)))) - <NUM_LIT:1> + precision<EOL><DEDENT>else:<EOL><INDENT>digits = precision<EOL><DEDENT>return np.around(x, digits)<EOL><DEDENT>
Round the fractional part of the given number