diff options
author | Gabriel Mansour <gabrielmansour@gmail.com> | 2010-01-30 12:38:33 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-02-07 12:12:09 -0800 |
commit | b235af702a086dd06fa9849ee47942e8ce82090d (patch) | |
tree | dc09ec6a9b6bd33fe0bca0fe81e8025beb0b559c /actionpack/lib/action_view | |
parent | a1a6e54d14b70e1d418d4939328e6eb24bdd8f3b (diff) | |
download | rails-b235af702a086dd06fa9849ee47942e8ce82090d.tar.gz rails-b235af702a086dd06fa9849ee47942e8ce82090d.tar.bz2 rails-b235af702a086dd06fa9849ee47942e8ce82090d.zip |
Fix pluralization for numbers formatted like '1.00'
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 412e0c82cb..b63617322f 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -187,7 +187,7 @@ module ActionView # pluralize(0, 'person') # # => 0 people def pluralize(count, singular, plural = nil) - "#{count || 0} " + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize)) + "#{count || 0} " + ((count == 1 || count =~ /^1(\.0+)?$/) ? singular : (plural || singular.pluralize)) end # Wraps the +text+ into lines no longer than +line_width+ width. This method |