Use g_format_size_full with G_FORMAT_SIZE_IEC_UNITS for RAM
This makes it more consistent with what other tools report.
This commit is contained in:
@@ -98,14 +98,14 @@ init_timeout (void)
|
||||
|
||||
g_object_get (settings, "show-memory-in-xbytes", &show_memory_in_xbytes, NULL);
|
||||
if (show_memory_in_xbytes) {
|
||||
used = g_format_size(memory_used);
|
||||
total = g_format_size(memory_total);
|
||||
used = g_format_size_full(memory_used, G_FORMAT_SIZE_IEC_UNITS);
|
||||
total = g_format_size_full(memory_total, G_FORMAT_SIZE_IEC_UNITS);
|
||||
g_snprintf (memory_info, 64,"%s / %s", used, total);
|
||||
g_free(used);
|
||||
g_free(total);
|
||||
|
||||
used = g_format_size(swap_used);
|
||||
total = g_format_size(swap_total);
|
||||
used = g_format_size_full(swap_used, G_FORMAT_SIZE_IEC_UNITS);
|
||||
total = g_format_size_full(swap_total, G_FORMAT_SIZE_IEC_UNITS);
|
||||
g_snprintf (swap_info, 64,"%s / %s", used, total);
|
||||
g_free(used);
|
||||
g_free(total);
|
||||
|
||||
@@ -234,8 +234,8 @@ model_update_tree_iter (GtkTreeModel *model, GtkTreeIter *iter, Task *task)
|
||||
GdkPixbuf *icon;
|
||||
#endif
|
||||
|
||||
vsz = g_format_size (task->vsz);
|
||||
rss = g_format_size (task->rss);
|
||||
vsz = g_format_size_full (task->vsz, G_FORMAT_SIZE_IEC_UNITS);
|
||||
rss = g_format_size_full (task->rss, G_FORMAT_SIZE_IEC_UNITS);
|
||||
|
||||
g_snprintf (value, 14, (more_precision) ? "%.2f" : "%.0f", task->cpu_user + task->cpu_system);
|
||||
g_snprintf (cpu, 16, _("%s%%"), value);
|
||||
|
||||
Reference in New Issue
Block a user