summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkgs/simple/q-power_supply.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/simple/q-power_supply.nix b/pkgs/simple/q-power_supply.nix
index 11597c1..5e7cd0d 100644
--- a/pkgs/simple/q-power_supply.nix
+++ b/pkgs/simple/q-power_supply.nix
@@ -129,7 +129,9 @@ writeDashBin "q-power_supply" ''
if (current_now != 0) {
out = out sprintf("/%.1f%s", current_now, current_unit)
}
- out = out sprintf(" %d%s", energy_full, energy_unit)
+ if (energy_full != 0) {
+ out = out sprintf(" %d%s", energy_full, energy_unit)
+ }
if (power_now != 0) {
out = out sprintf("/%.1f%s", power_now, power_unit)
}