Skip to content

Commit

Permalink
Add exchange_rate_scale
Browse files Browse the repository at this point in the history
  • Loading branch information
vnovitskyi committed Nov 10, 2023
1 parent 4c26d80 commit b5ec726
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cfonb/operation_detail/mmo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def self.apply(operation, line)

operation.original_amount = sign * BigDecimal(line.detail[4..17]) / (10**scale)
exchange_rate_value = line.detail[26..29]
operation.exchange_rate = BigDecimal(exchange_rate_value) / 1000 if exchange_rate_value
return unless exchange_rate_value

exchange_rate_scale = line.detail[18]
operation.exchange_rate = BigDecimal(exchange_rate_value) / (10**BigDecimal(exchange_rate_scale))
end

CFONB::OperationDetail.register('MMO', self)
Expand Down

0 comments on commit b5ec726

Please sign in to comment.