battery_remaining: Change float to double
authorAaron Marcher <me@drkhsh.at>
Sun, 20 May 2018 22:41:03 +0000 (00:41 +0200)
committerAaron Marcher <me@drkhsh.at>
Sun, 20 May 2018 22:41:03 +0000 (00:41 +0200)
components/battery.c

index 6105a37d77f89145f1d7fe8af8b7f78230338379..fa525be15b5d035c8a5118c8707d4bde2213bda3 100644 (file)
@@ -83,7 +83,7 @@
        battery_remaining(const char *bat)
        {
                int charge_now, current_now, m, h;
-               float timeleft;
+               double timeleft;
                char path[PATH_MAX], state[12];
 
                if (esnprintf(path, sizeof(path),
                                return NULL;
                        }
 
-                       timeleft = (float)charge_now / (float)current_now;
+                       timeleft = (double)charge_now / (double)current_now;
                        h = timeleft;
-                       m = (timeleft - (float)h) * 60;
+                       m = (timeleft - (double)h) * 60;
 
                        return bprintf("%dh %dm", h, m);
                }