Class: ADT::ColumnType::CurDouble

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

Instance Method Summary collapse

Instance Method Details

#flagObject



105
106
107
# File 'lib/adt/column_type.rb', line 105

def flag
  'D'
end

#type_cast(value, _table) ⇒ Object



101
102
103
# File 'lib/adt/column_type.rb', line 101

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