diff options
author | Aaron Marcher <me@drkhsh.at> | 2018-05-21 00:41:03 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-21 00:41:03 +0200 |
commit | a546d4b585234f66b82e048c2d7cb228b9e7fea4 (patch) | |
tree | 253beeede18f3120d08f1ac96566039d6b59dcf0 /components | |
parent | 103945e7bb8d3a4198cf175b8f6be09fe53ab9e1 (diff) |
battery_remaining: Change float to double
Diffstat (limited to 'components')
-rw-r--r-- | components/battery.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/battery.c b/components/battery.c index 6105a37..fa525be 100644 --- a/components/battery.c +++ b/components/battery.c @@ -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), @@ -107,9 +107,9 @@ 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); } |