Management of floats with a given precision; XmlMarshaller can dump unicode or str result.

This commit is contained in:
Gaetan Delannay 2010-01-29 11:28:39 +01:00
parent 3bb907ca5d
commit 2e1c6a6999
5 changed files with 37 additions and 7 deletions

View file

@ -262,6 +262,12 @@ class AbstractMixin:
elif vType == 'Boolean':
if v: return self.translate('yes', domain='plone')
else: return self.translate('no', domain='plone')
elif vType == 'Float':
if appyType['precision'] == None:
v = str(v)
else:
format = '%%.%df' % appyType['precision']
v = format % v
return v
def getAppyType(self, fieldName, forward=True, asDict=True):