Class: DBF::ColumnType::Currency

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

Instance Attribute Summary

Attributes inherited from Base

#decimal, #encoding

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DBF::ColumnType::Base

Instance Method Details

#type_cast(value) ⇒ Object

Parameters:



35
36
37
# File 'lib/dbf/column_type.rb', line 35

def type_cast(value)
  (value.unpack1('q<') / 10_000.0).to_f
end