Fix for incorrect display of invocation cost
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user