Skip to content

Commit

Permalink
FIx exchange_rate when empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
vnovitskyi committed Nov 16, 2023
1 parent 12488de commit 87a40f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cfonb/operation_detail/mmo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.apply(operation, line)

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

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

0 comments on commit 87a40f2

Please sign in to comment.