Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/ui/StatCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* always available via the title attribute (keyboard-navigable, hover tooltip).
*/

import { cn } from "@/lib/utils";
import { cn, formatCurrency } from "@/lib/utils";
import { ArrowUpRight, ArrowDownRight, AlertCircle } from "lucide-react";
import type { LucideIcon } from "lucide-react";
import { Sparkline } from "./Sparkline";
Expand Down Expand Up @@ -79,10 +79,7 @@ function formatValue(
switch (format) {
case "currency": {
const maxDecimals = asset === "XLM" ? 7 : 2;
const formatted = value.toLocaleString("en-US", {
maximumFractionDigits: maxDecimals,
});
const display = `${formatted} ${asset}`;
const display = formatCurrency(value, asset);
// Exact value for tooltip shows full asset-specific precision
const exact = `${value.toLocaleString("en-US", { maximumFractionDigits: maxDecimals })} ${asset}`;
return { display, exact };
Expand Down