I am using the Python Decimal class for accurate floating point arithmetic. I need to convert the number of results sequentially to a standard notation number as a string. However, very small decimal numbers are displayed in scientific notation by default.
>>> from decimal import Decimal
>>>
>>> d = Decimal("0.000001")
>>> d
Decimal('0.000001')
>>> str(d)
'0.000001'
>>> d = Decimal("0.000000001")
>>> d
Decimal('1E-9')
>>> str(d)
'1E-9'
How do I get str(d)to return '0.000000001'?
source
share