Fix for incorrect display of invocation cost

This commit is contained in:
Matt Aitken
2025-12-20 16:49:31 +00:00
parent 80e4a9bfda
commit 92439f8424
2 changed files with 13 additions and 3 deletions
@@ -129,6 +129,12 @@ function CellValue({
return <span className="tabular-nums">{formatCurrencyAccurate(value / 100)}</span>;
}
return <span>{String(value)}</span>;
case "costInDollars":
if (typeof value === "number") {
// Value is already in dollars, no conversion needed
return <span className="tabular-nums">{formatCurrencyAccurate(value)}</span>;
}
return <span>{String(value)}</span>;
case "machine": {
const preset = MachinePresetName.safeParse(value);
if (preset.success) {
@@ -201,7 +207,11 @@ function CellValue({
*/
function isRightAlignedColumn(column: OutputColumnMetadata): boolean {
// Check for custom render types that display numeric values
if (column.customRenderType === "duration" || column.customRenderType === "cost") {
if (
column.customRenderType === "duration" ||
column.customRenderType === "cost" ||
column.customRenderType === "costInDollars"
) {
return true;
}
+2 -2
View File
@@ -220,7 +220,7 @@ export const runsSchema: TableSchema = {
name: "compute_cost",
...column("Float64", {
description: "Compute cost in dollars",
customRenderType: "cost",
customRenderType: "costInDollars",
example: "0.000676",
}),
expression: "cost_in_cents / 100.0",
@@ -229,7 +229,7 @@ export const runsSchema: TableSchema = {
name: "invocation_cost",
...column("Float64", {
description: "Invocation cost in dollars",
customRenderType: "cost",
customRenderType: "costInDollars",
example: "0.000025",
}),
expression: "base_cost_in_cents / 100.0",