add class FloatValue for transparent number formatting'

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3312 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-03-30 17:36:51 +00:00
parent de820de330
commit ee26ab3ff4

View file

@ -116,6 +116,16 @@ class BaseObject(object):
collection = RelationSet
class FloatValue(float):
def __init__(self, value, decimals=2):
self.decimals = decimals
def __str__(self):
format = '%%.%if' % self.decimals
return (format % self).replace('.', ',')
# utility functions
def getUidForObject(obj, intIds=None):