battery_remaining: Change float to double
This commit is contained in:
parent
103945e7bb
commit
a546d4b585
1 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,7 @@
|
||||||
battery_remaining(const char *bat)
|
battery_remaining(const char *bat)
|
||||||
{
|
{
|
||||||
int charge_now, current_now, m, h;
|
int charge_now, current_now, m, h;
|
||||||
float timeleft;
|
double timeleft;
|
||||||
char path[PATH_MAX], state[12];
|
char path[PATH_MAX], state[12];
|
||||||
|
|
||||||
if (esnprintf(path, sizeof(path),
|
if (esnprintf(path, sizeof(path),
|
||||||
|
@ -107,9 +107,9 @@
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
timeleft = (float)charge_now / (float)current_now;
|
timeleft = (double)charge_now / (double)current_now;
|
||||||
h = timeleft;
|
h = timeleft;
|
||||||
m = (timeleft - (float)h) * 60;
|
m = (timeleft - (double)h) * 60;
|
||||||
|
|
||||||
return bprintf("%dh %dm", h, m);
|
return bprintf("%dh %dm", h, m);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue