fix network units

This commit is contained in:
csehviktor
2025-07-10 20:50:19 +02:00
parent 67f871882e
commit 6225a45848
4 changed files with 11 additions and 5 deletions
+4
View File
@@ -55,6 +55,10 @@ export function formatBytes(bytes: number | undefined): string {
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
}
export function formatBits(bits: number | undefined): string {
return formatBytes((bits ?? 0) / 8);
}
export function calcPercentage(
value: number | undefined,
total: number | undefined,