summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BatteryMeter.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/BatteryMeter.c b/BatteryMeter.c
index c76f3837..aed5f232 100644
--- a/BatteryMeter.c
+++ b/BatteryMeter.c
@@ -217,8 +217,7 @@ static double getProcBatData() {
if (totalRemain == 0)
return 0;
- double percent = totalFull > 0 ? ((double) totalRemain * 100) / (double) totalFull : 0;
- return percent;
+ return totalRemain * 100.0 / (double) totalFull;
}
static double getSysBatData() {