aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper.rb
diff options
context:
space:
mode:
authorJared Beck <jared@jaredbeck.com>2012-05-28 04:42:53 -0400
committerJared Beck <jared@jaredbeck.com>2012-05-28 04:42:53 -0400
commit371508c240f556539ce8891b05e8715f546b0e4d (patch)
treeb392a6621de630079df0c901d9a74c462bd2dc01 /activesupport/lib/active_support/number_helper.rb
parent135f620535d94af262d11f62bb814a2010701b1d (diff)
downloadrails-371508c240f556539ce8891b05e8715f546b0e4d.tar.gz
rails-371508c240f556539ce8891b05e8715f546b0e4d.tar.bz2
rails-371508c240f556539ce8891b05e8715f546b0e4d.zip
Fix handling of negative zero in number_to_currency
Diffstat (limited to 'activesupport/lib/active_support/number_helper.rb')
-rw-r--r--activesupport/lib/active_support/number_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb
index 8f5309c824..981ab0cb36 100644
--- a/activesupport/lib/active_support/number_helper.rb
+++ b/activesupport/lib/active_support/number_helper.rb
@@ -111,7 +111,7 @@ module ActiveSupport
unit = options.delete(:unit)
format = options.delete(:format)
- if number.to_f < 0
+ if number.to_f.phase != 0
format = options.delete(:negative_format)
number = number.respond_to?("abs") ? number.abs : number.sub(/^-/, '')
end