From c31124eb144c083a7ea05b48dcc7b5936aa3e1bc Mon Sep 17 00:00:00 2001 From: MacRimi Date: Fri, 10 Oct 2025 00:27:22 +0200 Subject: [PATCH] Update hardware.tsx --- AppImage/components/hardware.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index aae9b29..ad827e2 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -22,10 +22,13 @@ import useSWR from "swr" import { useState, useEffect } from "react" import { type HardwareData, type GPU, type PCIDevice, type StorageDevice, fetcher } from "../types/hardware" -const formatMemory = (memoryMB: number | string): string => { - const mb = typeof memoryMB === "string" ? Number.parseFloat(memoryMB) : memoryMB +const formatMemory = (memoryKB: number | string): string => { + const kb = typeof memoryKB === "string" ? Number.parseFloat(memoryKB) : memoryKB - if (isNaN(mb)) return "N/A" + if (isNaN(kb)) return "N/A" + + // Convert KB to MB + const mb = kb / 1024 // Convert to GB if >= 1024 MB if (mb >= 1024) {