Permalink
Browse files

Removing funny rescue behavior in LocalizedString in favor of NumberP…

…arser#try_parse
  • Loading branch information...
1 parent 697aaaa commit a113a811cab5852d77376cc562e810725d78235e Cameron Dutro committed Jan 16, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/twitter_cldr/localized/localized_string.rb
@@ -42,12 +42,12 @@ def to_i(options = {})
def to_f(options = {})
if TwitterCldr::Parsers::NumberParser.is_numeric?(@base_obj)
- TwitterCldr::Parsers::NumberParser.new(@locale).parse(@base_obj, options)
+ TwitterCldr::Parsers::NumberParser.new(@locale).try_parse(@base_obj, options) do |result|
+ result || @base_obj.to_f
+ end
else
@base_obj.to_f
end
- rescue
- @base_obj.to_f
end
def size

0 comments on commit a113a81

Please sign in to comment.