Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

259 B
Raw Blame
import { clamp, multiply } from "./math";

export function formatPercent(ratio: number): string {
  return `${Math.round(multiply(clamp(ratio, 0, 1), 100))}%`;
}

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