From b65f6a27152b71af03e44442d534da715dff8db8 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 9 Dec 2020 12:43:36 +0000 Subject: [PATCH] SysMon 1.35: add a space in numbers for better readability git-svn-id: svn://kolibrios.org@8353 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/sysmon/sysmon.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/programs/cmm/sysmon/sysmon.c b/programs/cmm/sysmon/sysmon.c index 831d7aa234..6949f56ccf 100644 --- a/programs/cmm/sysmon/sysmon.c +++ b/programs/cmm/sysmon/sysmon.c @@ -1,6 +1,6 @@ /* * System Monitor - * version 1.3 + * version 1.35 * Author: Leency */ @@ -218,9 +218,8 @@ void Processes__GetProcessList() void SelectList_DrawLine(dword i) { - int posy; - char cpu_use[16]; - char mem_use[16]; + int posy, j, len; + char cpu_use[16], mem_use[16], mem_use_pretty[16]; dword bg_color; proc_info Process; static unsigned maxcpu; @@ -238,9 +237,18 @@ void SelectList_DrawLine(dword i) WriteText(GAP+5, posy+select_list.text_y, 0x90, 0, #Process.name); - if (Process.use_memory < 3670016000) { + if (Process.use_memory < 3670016000) + { sprintf(#mem_use, "%i", Process.use_memory/1024); - WriteText(GAP+123 - calc(strlen(#mem_use)-6*8), posy+select_list.text_y, 0x90, 0x444444, #mem_use); + len = strlen(#mem_use); + strcpy(#mem_use_pretty, " "); + + for (j=1; j<=len; j++) { + EDI = sizeof(mem_use_pretty)-1-j - calc(j/4); + mem_use_pretty[EDI] = mem_use[len-j]; + } + + WriteText(GAP+109, posy+select_list.text_y, 0x90, 0x444444, #mem_use_pretty+16-9); } sprintf(#cpu_use, "%i", Process.use_cpu*100/maxcpu);