projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
103945e
)
battery_remaining: Change float to double
author
Aaron Marcher
<me@drkhsh.at>
Sun, 20 May 2018 22:41:03 +0000
(
00:41
+0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sun, 20 May 2018 22:41:03 +0000
(
00:41
+0200)
components/battery.c
patch
|
blob
|
history
diff --git
a/components/battery.c
b/components/battery.c
index 6105a37d77f89145f1d7fe8af8b7f78230338379..fa525be15b5d035c8a5118c8707d4bde2213bda3 100644
(file)
--- 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);
}