MCPcopy Create free account
hub / github.com/OperationT00/T-Code / progressBar

Method progressBar

src/main/java/com/tcode/agent/Agent.java:529–538  ·  view source on GitHub ↗
(double ratio, int width)

Source from the content-addressed store, hash-verified

527 }
528
529 private static String progressBar(double ratio, int width) {
530 ratio = Math.max(0, Math.min(1, ratio));
531 int filled = (int) Math.round(ratio * width);
532 StringBuilder bar = new StringBuilder("[");
533 for (int i = 0; i < width; i++) {
534 bar.append(i < filled ? '█' : '░');
535 }
536 bar.append("]");
537 return bar.toString();
538 }
539
540 private static String formatTokens(int tokens) {
541 if (tokens >= 1_000_000) return String.format("%.1fM", tokens / 1_000_000.0);

Callers 1

getContextStatusMethod · 0.95

Calls 2

appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected