fix: allow repeated platform checks and unify Alpha metric formatting
Deploy production / deploy (push) Successful in 54s
Deploy production / deploy (push) Successful in 54s
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
IconRefresh,
|
||||
} from "@douyinfe/semi-icons";
|
||||
import "./AlphaPage.css";
|
||||
import { formatAlphaMetric } from "../alphaMetrics";
|
||||
import type { ColumnProps } from "@douyinfe/semi-ui-19/lib/es/table/interface";
|
||||
import {
|
||||
api,
|
||||
@@ -84,8 +85,10 @@ function metricColor(key: string, value: unknown): string | undefined {
|
||||
return "var(--semi-color-danger)";
|
||||
}
|
||||
|
||||
/** Convert Margin only for display; filtering and sorting still use raw values. */
|
||||
/** Format metrics only for display; filtering and sorting still use raw values. */
|
||||
function formatMetric(key: string, value: unknown): string {
|
||||
const headline = formatAlphaMetric(key, value);
|
||||
if (headline !== undefined) return headline;
|
||||
if (key !== "margin") return formatNumber(value, 3);
|
||||
return typeof value === "number" && Number.isFinite(value)
|
||||
? `${formatNumber(value * 10000, 2)}bps`
|
||||
|
||||
Reference in New Issue
Block a user