From 371508c240f556539ce8891b05e8715f546b0e4d Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Mon, 28 May 2012 04:42:53 -0400 Subject: Fix handling of negative zero in number_to_currency --- activesupport/lib/active_support/number_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/number_helper.rb') 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 -- cgit v1.2.3