jh...@gmx.de wrote: > I need to convert Python decimal.Decimal data to the XMLSchema xs:decimal > datatype. This is reasonably straightforward, but there are some corner > cases. > > In particular, xs:decimal does not allow exponential notation like: > >>>> print Decimal('0.00000000000000000023430000000837483727772') > 2.3430000000837483727772E-19 >>>> > > Is there a convenient way to force a decimal.Decimal representation to not > use exponential representation?
> Any obvious alternatives I'm missing? Decimal numbers seem to support new-style formatting: >>> from decimal import Decimal >>> d = Decimal('2.3430000000837483727772E-19') >>> format(d, "f") '0.00000000000000000023430000000837483727772' Peter -- http://mail.python.org/mailman/listinfo/python-list