Commit cb34efb4 authored by Jérome Perrin's avatar Jérome Perrin

support properly -100.000, which was displayed as -.100.000


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28777 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 001b51bc
......@@ -1333,6 +1333,10 @@ class FloatWidget(TextWidget):
if input_style.find(decimal_separator) >= 0:
integer = value_list[0]
sign = ''
if integer.startswith('-'):
sign = '-'
integer = integer[1:]
i = len(integer) % 3
value = integer[:i]
while i != len(integer):
......@@ -1340,12 +1344,13 @@ class FloatWidget(TextWidget):
i += 3
if value[0] == decimal_separator:
value = value[1:]
value = '%s%s' % (sign, value)
else:
value = value_list[0]
if precision != 0:
value += decimal_point
if precision not in (None,''):
for i in range(0,precision):
if precision not in (None, ''):
for i in range(0, precision):
if i < len(value_list[1]):
value += value_list[1][i]
else:
......
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