Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

205 B
Raw Blame
export function formatCompact(n: number): string {
  if (n >= 10_000) return `${(n / 1000).toFixed(1).replace(/\.0$/, "")}K`;
  if (n >= 1_000) return `${(n / 1000).toFixed(1)}K`;
  return n.toString();
}