Class: DBI::Type::Float

Inherits:
Integer show all
Defined in:
lib/dbi/types.rb

Overview

Represents a decimal number with floating-point precision. Falls back to Integer.

Direct Known Subclasses

DBD::MSSQL::Type::Decimal, Decimal

Class Method Summary collapse

Class Method Details

.parse(obj) ⇒ Object



84
85
86
87
88
# File 'lib/dbi/types.rb', line 84

def self.parse(obj)
    return nil if Null.parse(obj).nil?
    return obj.to_f if obj.respond_to? :to_f
    super
end