Commit 24403e8c authored by Jérome Perrin's avatar Jérome Perrin

right align values from FloatFields


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3968 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent af33d985
......@@ -788,13 +788,26 @@ class FloatWidget(TextWidget):
value += value_list[1]
if percent:
value += '%'
return value
return value.strip()
def render(self, field, key, value, REQUEST):
"""Render Float input field
"""
value = self.format_value(field, value)
return TextWidgetInstance.render(field, key, value, REQUEST)
display_maxwidth = field.get_value('display_maxwidth') or 0
extra_keys = {}
if display_maxwidth > 0:
extra_keys['maxlength'] = display_maxwidth
return render_element( "input",
type="text",
name=key,
align="right",
css_class=field.get_value('css_class'),
value=value,
size=field.get_value('display_width'),
extra=field.get_value('extra'),
**extra_keys)
def render_view(self, field, value):
"""Render Float display field
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment