decimal.Decimal formatting

P

python

I have various decimals which eventually are written to an XML file.
Requirements indicate a precision of 11. I am currently having some
'issues' with Decimal("0"). When using
quantize(decimal.Decimal("1e-11")) the result is not 0.00000000000, but
1e-11.

Personally I agree 1e-11 is a better notation than 0.00000000000, but I
currently need the long one. Is there a way to overwrite the switch to
the scientific notation? Apparently there is a switch in notation
'between' 1e-6 and 1e-7.

Thijs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top