code: def _smart_round(figure, width=10, max_decimal=4):
      
      n_digits = len(str(int(figure)))
      n_decimal = width - (n_digits + 1)
      if n_decimal <= 1:
          return str(int(figure))
      else:
          n_decimal = min(n_decimal, max_decimal)
          format_str = "%." + str(n_decimal) + "f"
          return format_str % figure
docs: Round large numbers as integers, smaller numbers as decimals.