Re: [sc-dev] Proposal of a new format character from engineer's/scientist's prospective



On Wed, Jan 21, 2004 at 06:59:34AM -0500, Kohei Yoshida wrote:
On Wednesday 21 January 2004 04:31, Niklas Nebel wrote:
Kohei Yoshida wrote:
Something like that.  At least in my mind, the format code should consist
of two parts: one that specifies the movement of the decimal point, and
the other that specifies the base unit string such as m (meter), W
(watt), g (gram) etc and its modifier (M - mega, k - kilo, c - centi, u -
micro, n - nano, p - pico, ...).  So it should handle both >1 and <1
cases.

Oh, I thought you were proposing something automatic, one format that
always selects the right prefix.

Yeah I realize I wasn't clear on this.  Initially I was proposing something 
just like the thousand separator that does the reverse of it, and more 
flexible that is not restricted to powers of 3.  I thought it would be 
simpler to fit into the current format code scheme without being too 
intrusive than automatic handling of SI units.  That way the rest could be 
handled by macro.

Ahhh, so you just want something that would shrink rather than grow
the numbers.  An extension to the ,,,, hack in XL.  I suppose there
is a use for it, but the original kludge is ugly enough that I have
no idea how one would represent that in a similar fashion.  A format
of
    #0.....0    (use a north american locale with period for decimal)
would scare me

I'm all for automatic SI format, though.  That's actually better than my 
initial proposal, although obviously that requires a re-design of the current 
formatting system hence should be a long-term goal.

The implementation wouldn't be terribly difficult.  However, it
would be nice to get a format string that fit with the rather ugly
conceptual framework in Ms Excel.   If both our projects implement
it there would be a microscopic amount of presure on MS to do it
too.  For now I'll propose

    [%unit]             : scale to power of 3
    [%%unit]            : Use any si prefix
    [%%%unit]           : Use any power of 2 prefix

So you could write
    0.00[%%m]
and get 1.23cm

The interplay between specified precision and the selection of which
prefix could be a smidge tricky, but shouldn't present too many
problems.

I suppose we could wedge in
    [%number%unit]      : scale by number
If you really wanted arbitrary scale factors.  However that is a
slippery slope as people may want to add F -> C temperature
conversions one day.  Adding an full on expression parser in there
seems like over kill.

How does that sound ?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]