Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Capture file properties numbers

From: Dario Lombardo <dario.lombardo.ml@xxxxxxxxx>
Date: Wed, 3 Jan 2018 11:25:55 +0100
Hi guys
I'm looking at the code for the dialog window that prints the "capture file properties" (ui/qt/capture_file_properties_dialog.c:422)
I've found this assignment

captured_str = QString("%1").arg(summary.bytes/summary.packet_count + 0.5, 1, 'f', 1);

to compute the average packet size, that looks a bit weird to me. With a capture file of 3 packets, with sizes 10, 5 and 5, I would expect to have (10 + 5 + 5)/3 = 6.66. 
Instead, with the above code, I get 6.5 (integer division + 0.5). With a capture file of 3 packets, 10 bytes each, I would expect to have 10, instead I get 10.5.

The other values in the same method compute just the integer division, that could be enough, or the floating division, that would work better imho. No other values are computer like this.

Is there any reason for that? Am I missing something?
Should I submit a change?
Dario.