Keith wrote:
> I am considering writing a PEP for the inclusion of an engineering
> format specifier, and would appreciate input from others.
I think it's a good idea. I regularly type numbers into my pocket calculator
just to do this conversion.
Eike.
--
http://mail.python.org/mailman/listi
On Apr 27, 9:03 am, Mark Dickinson wrote:
> On Apr 27, 2:16 am, Keith wrote:
>
> > On Apr 26, 8:47 pm, MRAB wrote:
>
> > > "t" for "powers of a thousand", perhaps? (Or "m"?)
>
> > Both of those letters are fine. I kinda like "m" for the whole Greco-
> > Roman angle, now that you point it out :-
On Apr 25, 10:19 pm, Chris Rebert wrote:
> On Sun, Apr 25, 2010 at 9:42 PM, Keith wrote:
> > On Apr 26, 12:02 am, Chris Rebert wrote:
> >> On Sun, Apr 25, 2010 at 8:36 PM, Keith wrote:
> >> > I am considering writing a PEP for the inclusion of an engineering
> >> > format specifier, and would a
On Apr 27, 2:16 am, Keith wrote:
> On Apr 26, 8:47 pm, MRAB wrote:
>
> > "t" for "powers of a thousand", perhaps? (Or "m"?)
>
> Both of those letters are fine. I kinda like "m" for the whole Greco-
> Roman angle, now that you point it out :-)
By the way, there's already a feature request open f
Keith wrote:
I kinda like "m" for the whole Greco-
Roman angle, now that you point it out :-)
I like "m", too.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On 04/27/10 10:47, MRAB wrote:
> Mark Dickinson wrote:
>> On Apr 26, 4:36 am, Keith wrote:
>>> I am considering writing a PEP for the inclusion of an engineering
>>> format specifier, and would appreciate input from others.
>>
>>> [...]
>>
>>> I am thinking that if we simply added something like %
On 04/27/10 10:36, Keith wrote:
> I think it's worth making the print statement (or print function, as
> the case may be) let us do engineering notation, just like it lets us
> specify scientific notation.
The print statement/function does no magic at all in specifying how
numbers look like when.
On Apr 26, 8:47 pm, MRAB wrote:
> "t" for "powers of a thousand", perhaps? (Or "m"?)
Both of those letters are fine. I kinda like "m" for the whole Greco-
Roman angle, now that you point it out :-)
--Keith Brafford
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 26, 7:56 pm, Mark Dickinson wrote:
> On Apr 26, 6:47 am, Keith wrote:
>
> > From that document it appears that my decimal.Decimal(1234567) example
> > shows that the module has a bug:
>
> > Doc says:
> > [0,123,3] ===> "123E+3"
>
> > But Python does:>>> import decimal
> > >>> decimal.Deci
Mark Dickinson wrote:
On Apr 26, 4:36 am, Keith wrote:
I am considering writing a PEP for the inclusion of an engineering
format specifier, and would appreciate input from others.
[...]
I am thinking that if we simply added something like %n (for eNgineer)
to the list of format specifiers
On Apr 26, 5:33 am, Stefan Krah wrote:
> Keith wrote:
> > Even though this uses the to_eng_string() function, and even though I
> > am using the decimal.Context class:
>
> > >>> c = decimal.Context(prec=5)
> > >>> decimal.Decimal(1234567).to_eng_string(c)
> > '1234567'
>
> > That is not an engine
>Apparently either you and the General Decimal Arithmetic spec differ
>on what constitutes engineering notation, there's a bug in the Python
>decimal library,
You've distilled it precisely, and as you've shown in a different
post, it's the former.
The Python decimal module seems to implement corr
On Apr 26, 6:47 am, Keith wrote:
> From that document it appears that my decimal.Decimal(1234567) example
> shows that the module has a bug:
>
> Doc says:
> [0,123,3] ===> "123E+3"
>
> But Python does:>>> import decimal
> >>> decimal.Decimal(123000).to_eng_string()
>
> '123000'
That's not a bug.
On Apr 26, 4:36 am, Keith wrote:
> I am considering writing a PEP for the inclusion of an engineering
> format specifier, and would appreciate input from others.
> [...]
> I am thinking that if we simply added something like %n (for eNgineer)
> to the list of format specifiers that we could make
On 2010-04-26, Keith wrote:
> I am considering writing a PEP for the inclusion of an engineering
> format specifier, and would appreciate input from others.
I very regularly do something similar in various apps, though I often
want to specify the exponent (e.g. I always want to print a given
val
Keith wrote:
> Even though this uses the to_eng_string() function, and even though I
> am using the decimal.Context class:
>
> >>> c = decimal.Context(prec=5)
> >>> decimal.Decimal(1234567).to_eng_string(c)
> '1234567'
>
> That is not an engineering notation string.
To clarify further: The spec
Chris Rebert wrote:
> c = decimal.Context(prec=5)
> decimal.Decimal(1234567).to_eng_string(c)
> > '1234567'
> >
> > That is not an engineering notation string.
>
> Apparently either you and the General Decimal Arithmetic spec differ
> on what constitutes engineering notation, there's a
On 4/25/2010 11:36 PM, Keith wrote:
I am considering writing a PEP for the inclusion of an engineering
format specifier, and would appreciate input from others.
I tested that input is no problem, so the only question is output.
Do you think this idea has enough merit to make it to PEP status?
On Mon, Apr 26, 2010 at 3:39 PM, Chris Rebert wrote:
> "The conversion **exactly follows the rules for conversion to
> scientific numeric string** except in the case of finite numbers
> **where exponential notation is used.**"
>
Well, then maybe the conversion doesn't exactly follow the rules, i
On Apr 26, 1:19 am, Chris Rebert wrote:
> Apparently either you and the General Decimal Arithmetic spec differ
> on what constitutes engineering notation, there's a bug in the Python
> decimal library, or you're hitting some obscure part of the spec's
> definition.
snip
> The spec:http://speleotro
On Sun, Apr 25, 2010 at 10:25 PM, Xavier Ho wrote:
> On Mon, Apr 26, 2010 at 3:19 PM, Chris Rebert wrote:
>> Apparently either you and the General Decimal Arithmetic spec differ
>> on what constitutes engineering notation, there's a bug in the Python
>> decimal library, or you're hitting some obs
On Mon, Apr 26, 2010 at 3:19 PM, Chris Rebert wrote:
> Apparently either you and the General Decimal Arithmetic spec differ
> on what constitutes engineering notation, there's a bug in the Python
> decimal library, or you're hitting some obscure part of the spec's
> definition. I don't have the e
On Sun, Apr 25, 2010 at 9:42 PM, Keith wrote:
> On Apr 26, 12:02 am, Chris Rebert wrote:
>> On Sun, Apr 25, 2010 at 8:36 PM, Keith wrote:
>> > I am considering writing a PEP for the inclusion of an engineering
>> > format specifier, and would appreciate input from others.
> snip
>> Relevant rel
On Apr 26, 12:29 am, Steven D'Aprano wrote:
> On Sun, 25 Apr 2010 20:36:22 -0700, Keith wrote:
>>no one talks about 4.7e-5F, as they would rather see 47e-6
>>(micro). Instead of 2.2e-2, engineers need to see 22.0e-3 (milli).
>I'd be cautious about making claims about "no one"
Good point, and I
On Apr 26, 12:02 am, Chris Rebert wrote:
> On Sun, Apr 25, 2010 at 8:36 PM, Keith wrote:
> > I am considering writing a PEP for the inclusion of an engineering
> > format specifier, and would appreciate input from others.
snip
> Relevant related information:
> The Decimal datatype supports engin
On Sun, 25 Apr 2010 20:36:22 -0700, Keith wrote:
> I am considering writing a PEP for the inclusion of an engineering
> format specifier, and would appreciate input from others.
[...]
> For instance, no one talks about 4.7e-5F, as they would rather see 47e-6
> (micro). Instead of 2.2e-2, engineer
On Sun, Apr 25, 2010 at 8:36 PM, Keith wrote:
> I am considering writing a PEP for the inclusion of an engineering
> format specifier, and would appreciate input from others.
>
> Background (for those who don't already know about engineering
> notation):
>
> Engineering notation (EN) is type of fl
I am considering writing a PEP for the inclusion of an engineering
format specifier, and would appreciate input from others.
Background (for those who don't already know about engineering
notation):
Engineering notation (EN) is type of floating point representation.
The idea with EN is that the p
28 matches
Mail list logo