fix: instance type api update

This commit is contained in:
jialin
2026-05-30 08:28:38 +08:00
committed by Lawrence Li
parent d33167d070
commit 16a97772d3
10 changed files with 312 additions and 179 deletions
@@ -172,8 +172,8 @@ export const convertKiToGi = (value?: string): string | undefined => {
const match = /^(-?\d+(?:\.\d+)?)(Ki|Mi|Gi|Ti)$/.exec(value);
if (!match) return value;
const [, num, unit] = match;
if (unit === 'Ti') return `${_.round(Number(num), 2)}Ti`;
return `${_.round(Number(num) / GI_DIVISOR[unit], 2)}Gi`;
if (unit === 'Ti') return `${_.floor(Number(num), 0)}Ti`;
return `${_.floor(Number(num) / GI_DIVISOR[unit], 0)}Gi`;
};
const parseQuantity = (value?: string | null): number => {