Wireshark-dev: [Wireshark-dev] A library for formatting numbers in Wireshark

From: Richard Sharpe <realrichardsharpe@xxxxxxxxx>
Date: Sun, 24 Jun 2012 21:32:44 -0700
Hi folks,

During the first talk today I raised the issue of numbers not having
local specific thousands separators.

There seemed to be a lot of support for the notion that numbers should
be displayed in ways that make things much easier for people to
quickly comprehend.

After the talk, Sake Blok and Gerald Combs suggested that there should
be a set of routines, perhaps in the wsutil directory, for formatting
numbers in a more readable format.

These routines only need to format numbers, as they will be displayed
by existing code.

These routines should respect the locale settings that the user has
already set. That is, if the user wants the thousands separator to be
the period (.) then the number 1234 should be formatted as "1.234".
However, if the comma is their thousands separator, then it should be
formatted as "1,234". And, if the single quote is their thousands
separator (one guy today had numbers on his slides like that) then ...

However, there should additionally be format routines that will format
numbers in a more convenient form. For example, 25,134,000 would
display as 25M, but if the user hovers their mouse over the field, it
will display in full. (So, for example, the status bar would display
the number of packets captured as 25M.)

How do people feel about this? This will require code, but since there
appears to be no portable way to get these features, I suspect that it
is the only way, and that it is worth doing.

There soul

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)