diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-18 10:01:26 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-18 10:01:26 -0700 |
commit | a0a5a2a275dcf2d80ae405ae54fcc665b00824f1 (patch) | |
tree | 66f448bae31a58f99def73120cb3a60bdd6096a9 | |
parent | 98d3c41cfb95c3906dda526352c01c702d0aac8b (diff) | |
download | rails-a0a5a2a275dcf2d80ae405ae54fcc665b00824f1.tar.gz rails-a0a5a2a275dcf2d80ae405ae54fcc665b00824f1.tar.bz2 rails-a0a5a2a275dcf2d80ae405ae54fcc665b00824f1.zip |
implicitly return nil if there is no number
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 5ecacfc3a7..b5de5c3422 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -102,7 +102,7 @@ module ActionView # number_to_currency(1234567890.50, :unit => "£", :separator => ",", :delimiter => "", :format => "%n %u") # # => 1234567890,50 £ def number_to_currency(number, options = {}) - return nil if number.nil? + return unless number options.symbolize_keys! @@ -147,7 +147,7 @@ module ActionView # number_to_percentage(302.24398923423, :precision => 5) # => 302.24399% # number_to_percentage(1000, :locale => :fr) # => 1 000,000% def number_to_percentage(number, options = {}) - return nil if number.nil? + return unless number options.symbolize_keys! |