From 25839d592d32cc4321ef7d074d0447b347828369 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Tue, 11 Jan 2022 05:12:59 -0500 Subject: [PATCH] Fix mem padding when using GiB --- src/Terminal/commands/mem.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Terminal/commands/mem.ts b/src/Terminal/commands/mem.ts index 3d60772c0..a7f6f8f90 100644 --- a/src/Terminal/commands/mem.ts +++ b/src/Terminal/commands/mem.ts @@ -3,6 +3,7 @@ import { IRouter } from "../../ui/Router"; import { IPlayer } from "../../PersonObjects/IPlayer"; import { BaseServer } from "../../Server/BaseServer"; import { numeralWrapper } from "../../ui/numeralFormat"; +import { Settings } from "../../Settings/Settings"; export function mem( terminal: ITerminal, @@ -40,8 +41,9 @@ export function mem( ); const verboseEntries = script.ramUsageEntries?.sort((a, b) => b.cost - a.cost) ?? []; + const padding = Settings.UseIEC60027_2 ? 9 : 8; for (const entry of verboseEntries) { - terminal.print(`${numeralWrapper.formatRAM(entry.cost * numThreads).padStart(8)} | ${entry.name} (${entry.type})`); + terminal.print(`${numeralWrapper.formatRAM(entry.cost * numThreads).padStart(padding)} | ${entry.name} (${entry.type})`); } if (ramUsage > 0 && verboseEntries.length === 0) {