diff -r 6d91b5e87839 django/template/defaultfilters.py
a
|
b
|
def pluralize(value, arg=u's'):
|
850 | 850 | singular_suffix, plural_suffix = bits[:2] |
851 | 851 | |
852 | 852 | try: |
853 | | if int(value) != 1: |
| 853 | if float(value) != 1.0: |
854 | 854 | return plural_suffix |
855 | 855 | except ValueError: # Invalid string that's not a number. |
856 | 856 | pass |
diff -r 6d91b5e87839 tests/regressiontests/defaultfilters/tests.py
a
|
b
|
class DefaultFiltersTests(unittest.TestC
|
498 | 498 | self.assertEqual(pluralize(0,u'y,ies'), u'ies') |
499 | 499 | self.assertEqual(pluralize(2,u'y,ies'), u'ies') |
500 | 500 | self.assertEqual(pluralize(0,u'y,ies,error'), u'') |
| 501 | self.assertEqual(pluralize(0.5), u's') |
| 502 | self.assertEqual(pluralize(1.0), u'') |
| 503 | self.assertEqual(pluralize(1.5), u's') |
501 | 504 | |
502 | 505 | def test_phone2numeric(self): |
503 | 506 | self.assertEqual(phone2numeric(u'0800 flowers'), u'0800 3569377') |