diff options
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r-- | lib/rexml/functions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index c09ffdeae..d741dbdab 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 |