diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsx index c1889a4168..27ae34d96a 100644 --- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx +++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx @@ -72,7 +72,10 @@ function formatBytes(value: number | null): string | null { function formatGiB(value: number | null | undefined): string { const safe = isFiniteNumber(value) ? Math.max(0, value) : 0; const digits = safe >= 10 ? 1 : 2; - return `${safe.toFixed(digits)} GiB`; + // digits is never 0, so toFixed always leaves a decimal point and trimming + // trailing zeros cannot reach an integer digit. "64.0" reads as "64". + const text = safe.toFixed(digits).replace(/\.?0+$/, ""); + return `${text} GiB`; } function formatMb(value: number | null | undefined): string { @@ -515,15 +518,20 @@ export function ResourcesTab() { {/* Meter under the figures, so it spans their width instead of - being squeezed into the gap beside them. */} -