Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor percentage helper

  • Loading branch information...
commit c753e3af764f4888bc71720741158863b23d63c1 1 parent 1e78fed
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_view/helpers/number_helper.rb
View
3  actionpack/lib/action_view/helpers/number_helper.rb
@@ -196,7 +196,8 @@ def number_to_percentage(number, options = {})
if options[:raise]
raise
else
- e.number.to_s.html_safe? ? format.gsub(/%n/, e.number).html_safe : format.gsub(/%n/, e.number)
+ formatted_number = format.gsub(/%n/, e.number)
+ e.number.to_s.html_safe? ? formatted_number.html_safe : formatted_number
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.