]> git.sur5r.net Git - i3/i3status/commitdiff
Display wireless quality as percentage
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 24 Jun 2010 21:59:44 +0000 (23:59 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 24 Jun 2010 21:59:44 +0000 (23:59 +0200)
src/print_wireless_info.c

index e5d38fb3c0ae1bed043a762ac2a81bb185607942..28d9cdbcf057d480dc15d794facd18111111e43a 100644 (file)
@@ -101,7 +101,7 @@ void print_wireless_info(const char *interface, const char *format_up, const cha
                 if (BEGINS_WITH(walk+1, "quality")) {
                         int max_qual = get_wireless_quality_max(interface);
                         if (max_qual && max_qual >= quality)
-                                printf("%d/%d", quality, max_qual);
+                                printf("%d%%", (int)(quality * (100.0 / max_qual)));
                         else
                                 printf("%d", quality);
                         walk += strlen("quality");