summaryrefslogtreecommitdiff
path: root/components/netspeeds.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-05-21 14:44:21 +0200
committerAaron Marcher <me@drkhsh.at>2018-05-21 14:44:21 +0200
commit10dbc9543edd5b5a7929dd8fa87ed33dd545375c (patch)
tree6f95a31f3a4c3d95b317a3280870dffb5ba5d4e1 /components/netspeeds.c
parentfc0dde5a60a066b8506834f508aebf0ea5055990 (diff)
Merge fmt_human_2 and fmt_human_10 to one function
Now only one function, fmt_human, takes an additional argument "base".
Diffstat (limited to 'components/netspeeds.c')
-rw-r--r--components/netspeeds.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/components/netspeeds.c b/components/netspeeds.c
index 76557e0..4332024 100644
--- a/components/netspeeds.c
+++ b/components/netspeeds.c
@@ -29,7 +29,8 @@
return NULL;
}
- return fmt_human_2((rxbytes - oldrxbytes) * 1000 / interval);
+ return fmt_human((rxbytes - oldrxbytes) * 1000 / interval,
+ 1024);
}
const char *
@@ -54,7 +55,8 @@
return NULL;
}
- return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval);
+ return fmt_human((txbytes - oldtxbytes) * 1000 / interval,
+ 1024);
}
#elif defined(__OpenBSD__)
#include <string.h>
@@ -95,7 +97,8 @@
return NULL;
}
- return fmt_human_2((rxbytes - oldrxbytes) * 1000 / interval);
+ return fmt_human((rxbytes - oldrxbytes) * 1000 / interval,
+ 1024);
}
const char *
@@ -130,6 +133,7 @@
return NULL;
}
- return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval);
+ return fmt_human_2((txbytes - oldtxbytes) * 1000 / interval,
+ 1024);
}
#endif