Class: ADT::ColumnType::Double

Inherits:
Base
  • Object
show all
Defined in:
lib/adt/column_type.rb

Instance Method Summary collapse

Instance Method Details

#flagObject



46
47
48
# File 'lib/adt/column_type.rb', line 46

def flag
  'D'
end

#type_cast(value, _table) ⇒ Object



42
43
44
# File 'lib/adt/column_type.rb', line 42

def type_cast(value, _table)
  value.unpack1('D') <= 0.001 && value.unpack1('D') >= -0.001 ? 0.0 : value.unpack1('D')
end