beremiz

1eefc427419f
Parents 4278d5c1e414
Children dc94c71a2f25
Fixed bug with decimal value string formatting
--- a/xmlclass/xsdschema.py Thu Nov 07 00:31:46 2013 +0100
+++ b/xmlclass/xsdschema.py Mon Nov 11 00:59:19 2013 +0100
@@ -45,7 +45,8 @@
return generateXMLTextMethod
def GenerateFloatXMLText(extra_values=[], decimal=None):
- float_format = ("{:.%dg}" % decimal).format if decimal is not None else str
+ float_format = (lambda x: "{:.{width}f}".format(x, width=decimal).rstrip('0')
+ if decimal is not None else str)
def generateXMLTextMethod(value, name=None, indent=0):
text = ""
if name is not None: