summaryrefslogtreecommitdiff
path: root/statuses/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'statuses/tools.c')
-rw-r--r--statuses/tools.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/statuses/tools.c b/statuses/tools.c
new file mode 100644
index 0000000..1e0385d
--- /dev/null
+++ b/statuses/tools.c
@@ -0,0 +1,24 @@
+#include "tools.h"
+
+char powertochar(int power)
+{
+ switch(power)
+ {
+ case 0:
+ return 'b';
+ case 1:
+ return 'k';
+ case 2:
+ return 'M';
+ case 3:
+ return 'G';
+ case 4:
+ return 'T';
+ case 5:
+ return 'P';
+ case 6:
+ return 'E';
+ }
+
+ return '?';
+}