aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/number_helper.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-18 09:53:01 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-18 09:53:01 -0700
commit081e15f104b7da597114a8539f519953f166e096 (patch)
tree47b7d3fc992db141d0228b505af127e7def5c95c /actionpack/lib/action_view/helpers/number_helper.rb
parent330327eeecd3666a7b9b407e804b36cb1bc3cb48 (diff)
downloadrails-081e15f104b7da597114a8539f519953f166e096.tar.gz
rails-081e15f104b7da597114a8539f519953f166e096.tar.bz2
rails-081e15f104b7da597114a8539f519953f166e096.zip
join strings rather than resizing buffer
Diffstat (limited to 'actionpack/lib/action_view/helpers/number_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb4
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 82f3f222c6..28106b5bce 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -70,11 +70,11 @@ module ActionView
number.slice!(0, 1) if number.starts_with?('-')
end
- str = ""
+ str = []
str << "+#{country_code}#{delimiter}" unless country_code.blank?
str << number
str << " x #{extension}" unless extension.blank?
- ERB::Util.html_escape(str)
+ ERB::Util.html_escape(str.join)
end
# Formats a +number+ into a currency string (e.g., $13.65). You can customize the format