mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 586 forks source link

Decimal values in scientific notation #1191

Closed KACAH closed 3 years ago

KACAH commented 3 years ago

Hi!

XML Schema Definition (XSD) does not support scientific notation (1.1234e-3) in xsd:decimal by standart. Some resources doesn't mention scientific notation at all. Some mention the restriction directly.

The decimal separator is always a point (.), and no separation at the thousand mark may be added. There is no support for scientific notation.

Right now str(value) in Decimal builtin type makes the xml value without beeing aware of this restriction. Here is a small fix and couple of tests for this case. The fix uses Python format {:f} method which converts value to Fixed Point string.

mvantellingen commented 3 years ago

Thanks!