[FIX] __init__ metho store value in string format in float_format class.

bzr revid: ysa@tinyerp.com-20110530114350-lp27vh30y45zsmp8
This commit is contained in:
Yogesh (OpenERP) 2011-05-30 17:13:50 +05:30
parent 9c1d85e298
commit a5e9795ed1
1 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ class _format(object):
class _float_format(float, _format):
def __init__(self,value):
super(_float_format, self).__init__()
self.val = value
self.val = value and str(value) or str(0.0)
def __str__(self):
digits = 2
@ -86,7 +86,7 @@ class _float_format(float, _format):
digits = self._field.digits[1]
if hasattr(self, 'lang_obj'):
return self.lang_obj.format('%.' + str(digits) + 'f', self.name, True)
return str(self.val)
return self.val
class _int_format(int, _format):
def __init__(self,value):