Skip to content

Commit

Permalink
more human readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Oct 28, 2024
1 parent 31352ed commit 72d3575
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/chat_gui4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1352,10 +1352,27 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {

if (fts != nullptr) {
ImGui::SeparatorText("transfer stats");
ImGui::Text("rate up : %.1f Bytes/s", fts->rate_up);
ImGui::Text("rate down : %.1f Bytes/s", fts->rate_down);
ImGui::Text("total up : %lu Bytes", fts->total_up);
ImGui::Text("total down: %lu Bytes", fts->total_down);

{
const char* byte_suffix = "???";
int64_t byte_divider = sizeToHumanReadable(fts->rate_up, byte_suffix);
ImGui::Text("rate up : %.2f %s/s", fts->rate_up/byte_divider, byte_suffix);
}
{
const char* byte_suffix = "???";
int64_t byte_divider = sizeToHumanReadable(fts->rate_down, byte_suffix);
ImGui::Text("rate down : %.2f %s/s", fts->rate_down/byte_divider, byte_suffix);
}
{
const char* byte_suffix = "???";
int64_t byte_divider = sizeToHumanReadable(fts->total_up, byte_suffix);
ImGui::Text("total up : %.3f %s", double(fts->total_up)/byte_divider, byte_suffix);
}
{
const char* byte_suffix = "???";
int64_t byte_divider = sizeToHumanReadable(fts->total_down, byte_suffix);
ImGui::Text("total down: %.3f %s", double(fts->total_down)/byte_divider, byte_suffix);
}
}

ImGui::EndTooltip();
Expand Down

0 comments on commit 72d3575

Please sign in to comment.