code: def format_exp_floats(decimals):
      
      threshold = 10 ** 5
      return (
          lambda n: "{:.{prec}e}".format(n, prec=decimals) if n > threshold else "{:4.{prec}f}".format(n, prec=decimals)
      )
docs: sometimes the exp. column can be too large