diff options
author | jkre <usokk@student.kit.edu> | 2023-12-14 01:39:00 +0100 |
---|---|---|
committer | jkre <usokk@student.kit.edu> | 2023-12-14 01:39:00 +0100 |
commit | 7a188bfaaf19266b2d74336ca85ccb46fa0f111a (patch) | |
tree | 0c21ecd6fcdc79c5ccd6720a2735901a8bfa8d79 /src | |
parent | 1ad1418771bd69c70674388d64a4965f9f7d0582 (diff) |
round wattage to second decimal
Diffstat (limited to 'src')
-rw-r--r-- | src/btop_draw.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index b5e75ec..9e49d1f 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -724,7 +724,7 @@ namespace Cpu { old_status = status; const string str_time = (seconds > 0 ? sec_to_dhms(seconds, true, true) : ""); const string str_percent = to_string(percent) + '%'; - const string str_watts = (watts != -1 ? to_string(watts) + 'W' : ""); + const string str_watts = (watts != -1 ? fmt::format("{:.2f}", watts) + 'W' : ""); const auto& bat_symbol = bat_symbols.at((bat_symbols.contains(status) ? status : "unknown")); const int current_len = (Term::width >= 100 ? 11 : 0) + str_time.size() + str_percent.size() + str_watts.size() + to_string(Config::getI("update_ms")).size(); const int current_pos = Term::width - current_len - 17; |