code: def prettyMemory(k, field=None, isBytes=False):
      
      if isBytes:
          k /= 1024
      if k < 1024:
          return padStr("%gK" % k, field)
      if k < (1024 * 1024):
          return padStr("%.1fM" % (old_div(k, 1024.0)), field)
      if k < (1024 * 1024 * 1024):
          return padStr("%.1fG" % (k / 1024.0 / 1024.0), field)
      if k < (1024 * 1024 * 1024 * 1024):
          return padStr("%.1fT" % (k / 1024.0 / 1024.0 / 1024.0), field)
      if k < (1024 * 1024 * 1024 * 1024 * 1024):
          return padStr("%.1fP" % (k / 1024.0 / 1024.0 / 1024.0 / 1024.0), field)
docs: Given input k as kilobytes, return a nicely formatted string.