From 605d5b7832d55e9c70d1ff97cde5fdaf19fbd627 Mon Sep 17 00:00:00 2001 From: Palabola Date: Tue, 22 Oct 2024 11:43:29 +0200 Subject: [PATCH] more getMemory fixes --- src/app/pages/server-compare/server-compare.component.ts | 2 +- src/app/pages/server-og/server-og.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/server-compare/server-compare.component.ts b/src/app/pages/server-compare/server-compare.component.ts index f6ef7dd8..9a623770 100644 --- a/src/app/pages/server-compare/server-compare.component.ts +++ b/src/app/pages/server-compare/server-compare.component.ts @@ -452,7 +452,7 @@ export class ServerCompareComponent implements OnInit, AfterViewInit { } getMemory(item: ExtendedServerDetails) { - return ((item.memory_amount || 0) / 1024).toFixed((item.memory_amount || 0) > 1024 ? 0 : 1) + ' GiB'; + return ((item.memory_amount || 0) / 1024).toFixed((item.memory_amount || 0) >= 1024 ? 0 : 1) + ' GiB'; } getGPUMemory(item: ExtendedServerDetails) { diff --git a/src/app/pages/server-og/server-og.component.ts b/src/app/pages/server-og/server-og.component.ts index 9caeb94a..d6d19c59 100644 --- a/src/app/pages/server-og/server-og.component.ts +++ b/src/app/pages/server-og/server-og.component.ts @@ -94,7 +94,7 @@ export class ServerOGComponent implements OnInit { getMemory(memory: number | undefined = undefined) { const memoryAmount = memory || this.serverDetails.memory_amount || 0; - return ((memoryAmount) / 1024).toFixed((memoryAmount ? 0 : 1)) + ' GiB'; + return ((memoryAmount) / 1024).toFixed((memoryAmount >= 1024 ? 0 : 1)) + ' GiB'; } getStorage() {