mirror of https://github.com/xzeldon/htop.git
change swap to M for consistency. Closes #63.
This commit is contained in:
parent
ab118c2dbe
commit
eb1cd4aca6
|
@ -30,18 +30,14 @@ int SwapMeter_attributes[] = {
|
||||||
|
|
||||||
/* NOTE: Value is in kilobytes */
|
/* NOTE: Value is in kilobytes */
|
||||||
static void SwapMeter_humanNumber(char* buffer, const long int* value) {
|
static void SwapMeter_humanNumber(char* buffer, const long int* value) {
|
||||||
if (*value >= 10*GIGABYTE)
|
sprintf(buffer, "%ldM ", *value / MEGABYTE);
|
||||||
sprintf(buffer, "%ldG ", *value / GIGABYTE);
|
|
||||||
else if (*value >= 10*MEGABYTE)
|
|
||||||
sprintf(buffer, "%ldM ", *value / MEGABYTE);
|
|
||||||
else
|
|
||||||
sprintf(buffer, "%ldK ", *value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SwapMeter_setValues(Meter* this, char* buffer, int len) {
|
static void SwapMeter_setValues(Meter* this, char* buffer, int len) {
|
||||||
long int usedSwap = this->pl->usedSwap;
|
long int usedSwap = this->pl->usedSwap;
|
||||||
this->total = this->pl->totalSwap;
|
this->total = this->pl->totalSwap;
|
||||||
this->values[0] = usedSwap;
|
this->values[0] = usedSwap;
|
||||||
|
|
||||||
snprintf(buffer, len, "%ld/%ldMB", (long int) usedSwap / MEGABYTE, (long int) this->total / MEGABYTE);
|
snprintf(buffer, len, "%ld/%ldMB", (long int) usedSwap / MEGABYTE, (long int) this->total / MEGABYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue