Skip to content

Commit

Permalink
fix: crash charts (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Feb 18, 2025
1 parent 4f8d72f commit 4f925ad
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ function formatValue(value: unknown, dataKey: string) {
}
let formattedValue: number;
if (typeof value === "number") {
if (dataKey.includes("cost")) {
if (dataKey?.includes("cost")) {
formattedValue = parseFloat(value.toFixed(6));
} else {
formattedValue = parseFloat(value.toFixed(2));
}

if (dataKey.includes("latency")) {
if (dataKey?.includes("latency")) {
return `${formattedValue}s`;
}

if (dataKey.includes("cost")) {
if (dataKey?.includes("cost")) {
return `$${formattedValue}`;
}

Expand Down

0 comments on commit 4f925ad

Please sign in to comment.