ast has a function fmtscale(3) that handles this issue in one spot
relevance to solaris is that ksh93 exposes this function via
libast/sfprintf(3) and finally its builtin printf(1)

from ksh93 try
        printf $'%#d %#i\n' 5000 5000 123456789 123456789
and it should produce
        5.0k 4.9Ki
        124M 118Mi
unit labeling taken from ISO/IEC 18025 EDCS units

-- Glenn Fowler -- AT&T Research, Florham Park NJ --

On Sun, 18 May 2008 22:10:02 -0700 Darren Reed wrote:
> > On May 18, 2008, at 2:05 PM, Joseph Kowalski wrote:
> >
> >> / /I think all (if not most) questions around the spelling of the
> >> various magnitudes can be found in:
> >>
> >>    PSARC/2001/183  df -h and -H options
> >>
> >> If there is an old case, or a newer one which alters this precedent,  
> >> I'm
> >> not aware of one.
> >
> >
> > FWIW, zfs also uses an uppercase K...
> >
> > [daleg at mercury]~$ zfs get recordsize local/home
> > NAME        PROPERTY    VALUE       SOURCE
> > local/home  recordsize  128K        default

> Yes, I'd like to see all of our commands behave the same way...

> And given the prior use of kilo vs kibi (etc), I think the common
> sense thing to do is stick with the abbreviation letters meaning
> what they do elsewhere...

> At some point in the future, we need to rethink what the output
> of our commands should be, with respect to IEEE/IEC standards
> that introduced kibibyte, etc, (including if we care about those
> standards) but that shouldn't be this case.


Reply via email to