From ec847fad4e0c1b96c6cf91e7ff14ef0820f7ccc3 Mon Sep 17 00:00:00 2001 From: ser Date: Fri, 8 Sep 2006 02:03:44 +0000 Subject: Merged changes into HEAD from REXML 3.1.5. The list of bug fixes/enhancements is at: http://www.germane-software.com/projects/rexml/query?status=closed&milestone=3.1.5 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/functions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rexml/functions.rb') diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index c09ffdeae7..d741dbdab7 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -326,8 +326,8 @@ module REXML else str = string( object ) #puts "STRING OF #{object.inspect} = #{str}" - if str =~ /^\d+/ - object.to_s.to_f + if str =~ /^-?\.?\d/ + str.to_f else (0.0 / 0.0) end -- cgit v1.2.3