#16723: Pluralize filter shouldn't pluralize decimal/float values between 1 and 
2
---------------------+---------------------------------
 Reporter:  rfugger  |          Owner:  nobody
     Type:  Bug      |         Status:  new
Milestone:           |      Component:  Template system
  Version:  SVN      |       Severity:  Normal
 Keywords:           |   Triage Stage:  Unreviewed
Has patch:  0        |  Easy pickings:  0
    UI/UX:  0        |
---------------------+---------------------------------
 The pluralize filter's support for floating point/decimal numbers is
 buggy.  Its check for plurality is:

 {{{
 if int(value) != 1
 }}}

 which unfortunately catches floats 1.0 < x < 2.0 that shouldn't be
 pluralized in English.

 Example:

 {{{
 pound{{ weight|pluralize:"s" }}
 }}}

 When `weight` is 1.3, this gives "1.3 pound", which is incorrect.  "1.3
 pounds" is the expected result.

 The filter should probably also pluralize 1.0 when it is given as a
 floating point/decimal number, because native speakers will generally
 pluralize all decimal numbers.  ("One-point-oh hours," not "One-point-oh
 hour".)

 Reference:
 http://www.englishforums.com/English/1119PluralOrSingular/wdvmb/post.htm#684376

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16723>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to