decimal.Decimal formatting

Discussion in 'Python' started by python@lists.fastmail.net, Jul 19, 2010.

  1. Guest

    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
     
    , Jul 19, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ven
    Replies:
    3
    Views:
    1,329
  2. Gilbert Fine
    Replies:
    8
    Views:
    904
    Zentrader
    Aug 1, 2007
  3. Vitaliy
    Replies:
    1
    Views:
    477
    Peter Otten
    May 29, 2008
  4. valpa
    Replies:
    11
    Views:
    1,522
    Steven D'Aprano
    Mar 24, 2009
  5. Jeff Beardsley

    A possible change to decimal.Decimal?

    Jeff Beardsley, Mar 2, 2012, in forum: Python
    Replies:
    5
    Views:
    231
    Ethan Furman
    Mar 4, 2012
Loading...

Share This Page