diff --git a/BatteryMeter.c b/BatteryMeter.c index c76f3837bd5c48db78f415c1c3d355bb1cc34c86..aed5f23259edeb886a9ae4a175ac925775c18e43 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() {