Commit 23d5343a authored by Tatuya Kamada's avatar Tatuya Kamada

Unit Test: Make sure how FloatFiled rounding.

parent 60f94952
......@@ -110,6 +110,15 @@ class TestFloatField(ERP5TypeTestCase):
self.field.values['input_style'] = '-1,234.5'
self.field.values['precision'] = 0
self.assertEquals('-1,000', self.widget.format_value(self.field, -1000.25))
self.assertEquals('-1,000', self.widget.format_value(self.field, -1000.49))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.99))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.80))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.70))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.60))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.59))
self.assertEquals('-1,001', self.widget.format_value(self.field, -1000.51))
# this is not -1,001 (is this a specification?)
self.assertEquals('-1,000', self.widget.format_value(self.field, -1000.50))
def test_format_percent_style(self):
self.field.values['input_style'] = '-12.3%'
......
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