On Thu, Mar 13, 2025 at 11:07:47AM +0100, Morten Brørup wrote:
> > > +{
> > > + const char *prefix = "kMGTPE";
> > 
> > Why is "k" in lower case compared to the others all in upper-case?
> 
> That's what the standardization bodies decided. Let's stick with that!
> 
Ok

> 
> > > + * Sample outputs with "use_iec" disabled and enabled: + * 0 : "0 ",
> > > "0 " + * 700 : "700 ", "700 " + * 1000 : "1.00 k", "1000 " + * 1024 :
> > > "1.02 k", "1.00 ki" + * 21474836480 : "21.5 G", "20.0 Gi" + *
> > > 109951162777600 : "110 T", "100 Ti" + *
> > 
> > I would omit the space before the suffixes in the output. As well as
> > looking better to me, it also solves the issue of the non-suffixed
> > numbers having a trailing space.
> 
> The space could be optional, like the "use_iec" parameter.  I would
> certainly expect the space when appending a unit, e.g. "bit/s": "700
> bit/s" or "1.00 kbit/s".
> 
> Or when the appended unit is seconds, e.g. for latency/jitter: "12.3 ms"
> or "123 us".
> 
> With raw numbers (i.e. without a unit appended), it's probably a matter
> of personal preference, so I'm not going to insist here.  I still prefer
> it, but only when a postfix is present.
> 
> In the SmartShare GUI, we output with the space, and accept input both
> with and without it.
> 
Ok to keep the space within the string or have it optional. Although it
seems weird to me initially having a trailing space in some cases but not
others, it does make sense in the case of appending something like "bits",
or "B" to the string. Therefore, ok to keep things as now. Tend towards not
having an optional parameter for it, for the sake of simplicity, but ok
either way.

/Bruce

Reply via email to