Antti Haapala added the comment:

Raymond: your doc patch is not quite right. Decimal('123e1') is converted to 
Decimal('1.23e3') internally already; so that str(d) will print 1.23e3, 
scientific notation of that number is '1.23e3' and engineering notation is 
'1.23e3', thus not a good example. A better example would be  Also, the 
engineering notation is a string, not a Decimal instance.

Also, now that I test it, the whole `to_eng_string` seems to be utterly broken, 
same applies to "to_sci_string". They do not print in scientific notation if 
the exponent in the original number was 0:

    decimal.Decimal('123456789101214161820222426.0e0').to_eng_string()

And all operations with decimal will now generate numbers with exponent of 0 if 
it is within their precision, so no engineering notation is ever printed, duh.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27720>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to