// Formats a numeric USD value as "$1,234.56". Returns "$—" when the value is
// missing (loading / unavailable), so callers don't repeat the fallback.
export function formatUsd(value: number | null | undefined): string {
  if (value == null) return '$—'
  return `$${value.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
}
