summaryrefslogtreecommitdiffstats
path: root/src/detaileddialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/detaileddialog.cpp')
-rw-r--r--src/detaileddialog.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/detaileddialog.cpp b/src/detaileddialog.cpp
index 76340b5..851d844 100644
--- a/src/detaileddialog.cpp
+++ b/src/detaileddialog.cpp
@@ -273,12 +273,17 @@ void detaileddialog::setPowerConsumption() {
// refresh battery collection
primaryBatteries = hwinfo->getPrimaryBatteries();
- int rate = primaryBatteries->getCurrentRate();
+ double rate = primaryBatteries->getCurrentRate();
- if (rate > 0 && !primaryBatteries->getChargeLevelUnit().isEmpty()) {
+ if (rate > 0 && !primaryBatteries->getChargeLevelUnit().isEmpty()) {
TQString _val;
- _val.setNum(rate);
+ if (rate > 100) {
+ _val = TQString("%L1").arg((int)rate);
+ }
+ else {
+ _val = TQString("%L1").arg(rate, 0, 'g', 3);
+ }
_val += " " + primaryBatteries->getChargeLevelUnit().remove('h');
tl_powerConsValue->setText(_val);