aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/number_helper')
-rw-r--r--activesupport/lib/active_support/number_helper/number_converter.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_converter.rb b/activesupport/lib/active_support/number_helper/number_converter.rb
index 537bf1e5b6..471c686997 100644
--- a/activesupport/lib/active_support/number_helper/number_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_converter.rb
@@ -119,14 +119,18 @@ module ActiveSupport
end
def initialize(number, options)
- @number = number
- @opts = options.symbolize_keys
+ @number = number
+ @opts = options.symbolize_keys
end
def execute
- return unless @number
- return @number if validate_float? && !valid_float?
- convert
+ if !@number
+ nil
+ elsif validate_float? && !valid_float?
+ @number
+ else
+ convert
+ end
end
private