diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-04-24 19:03:07 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-04-24 19:03:07 -0300 |
commit | eb1cd4aca616afd74afa955bb8050157143bcf95 (patch) | |
tree | 7100a5bb091aadcfba4aa0371ecb40b5adb619b1 /SwapMeter.c | |
parent | ab118c2dbef222ed509a3a8244d80ceb93aae692 (diff) |
change swap to M for consistency. Closes #63.
Diffstat (limited to 'SwapMeter.c')
-rw-r--r-- | SwapMeter.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/SwapMeter.c b/SwapMeter.c index 6bdf612c..2cb86d5e 100644 --- a/SwapMeter.c +++ b/SwapMeter.c @@ -30,18 +30,14 @@ int SwapMeter_attributes[] = { /* NOTE: Value is in kilobytes */ static void SwapMeter_humanNumber(char* buffer, const long int* value) { - if (*value >= 10*GIGABYTE) - sprintf(buffer, "%ldG ", *value / GIGABYTE); - else if (*value >= 10*MEGABYTE) - sprintf(buffer, "%ldM ", *value / MEGABYTE); - else - sprintf(buffer, "%ldK ", *value); + sprintf(buffer, "%ldM ", *value / MEGABYTE); } static void SwapMeter_setValues(Meter* this, char* buffer, int len) { long int usedSwap = this->pl->usedSwap; this->total = this->pl->totalSwap; this->values[0] = usedSwap; + snprintf(buffer, len, "%ld/%ldMB", (long int) usedSwap / MEGABYTE, (long int) this->total / MEGABYTE); } |