Class: LedgerSync::Adaptors::QuickBooksOnline::LedgerSerializerType::AmountType

Inherits:
LedgerSerializerType::ValueType show all
Defined in:
lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb

Instance Method Summary collapse

Instance Method Details

#convert_from_ledger(value:) ⇒ Object



8
9
10
11
12
# File 'lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb', line 8

def convert_from_ledger(value:)
  return if value.nil?

  (value * 100).to_i
end

#convert_from_local(value:) ⇒ Object



14
15
16
17
18
# File 'lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb', line 14

def convert_from_local(value:)
  return if value.nil?

  value / 100.0
end