Component evidence

UI Utility Functions (lib/utils.ts)

Agentic-Tool-Optimization · apps/desktop/src/lib/utils.ts · typescript · MIT
uidev-toolsfw:tailwindfw:react

Provides Tailwind CSS class merging and number/currency formatting helpers. Use this in React or desktop apps to simplify styling and data presentation.

Source preview public preview
// Source: https://github.com/WillNigri/Agentic-Tool-Optimization | License: MIT | Copyright 2026 ClaudeScope Contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

export function formatNumber(n: number): string {
  if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
  if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
  return n.toString();
}

export function formatCurrency(cents: number): string {
  return `$${(cents / 100).toFixed(2)}`;
}