Improve terminal chart loading states

This commit is contained in:
2569718930@qq.com
2026-05-30 22:37:08 +08:00
parent a48a7bcca5
commit 6222f60573
4 changed files with 93 additions and 3 deletions
@@ -17,6 +17,8 @@ export function money(value: unknown) {
}
export function temp(value: unknown, unit?: string | null) {
if (value == null) return "--";
if (typeof value === "string" && value.trim() === "") return "--";
const n = Number(value);
if (!Number.isFinite(n)) return "--";
return `${n.toFixed(1)}${unit || "°"}`;