parameters: (x, precision: int)
docstring: Round the fractional part of the given number
docstring_summary: Round the fractional part of the given number
docstring_tokens: Round the fractional part of the given number
function: def _round_frac(x, precision: int):
      """
      Round the fractional part of the given number
      """
      if not np.isfinite(x) or x == 0:
          return x
      else:
          frac, whole = np.modf(x)
          if whole == 0:
              digits = -int(np.floor(np.log10(abs(frac)))) - 1 + precision
          else:
              digits = precision
          return np.around(x, digits)
function_tokens: def _round_frac ( x , precision : int ) : if not np . isfinite ( x ) or x == 0 : return x else : frac , whole = np . modf ( x ) if whole == 0 : digits = - int ( np . floor ( np . log10 ( abs ( frac ) ) ) ) - 1 + precision else : digits = precision return np . around ( x , digits )