Skip to content

Commit

Permalink
more getMemory fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Palabola committed Oct 22, 2024
1 parent d997ff4 commit 605d5b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/server-compare/server-compare.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/server-og/server-og.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 605d5b7

Please sign in to comment.