# File temp/functions.rb, line 335 def Functions::number( object=nil ) object = @@context[:node] unless object case object when true Float(1) when false Float(0) when Array number(string( object )) when Numeric object.to_f else str = string( object ) # If XPath ever gets scientific notation... #if str =~ /^\s*-?(\d*\.?\d+|\d+\.)([Ee]\d*)?\s*$/ if str =~ /^\s*-?(\d*\.?\d+|\d+\.)\s*$/ str.to_f else (0.0 / 0.0) end end end