Management of floats with a given precision; XmlMarshaller can dump unicode or str result.
This commit is contained in:
parent
3bb907ca5d
commit
2e1c6a6999
5 changed files with 37 additions and 7 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue