Skip to content

Commit f275d7f

Browse files
committed
fix(csv): fix format of usd value
1 parent a448c6f commit f275d7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/explorer/lib/explorer/chain/csv_export/address_transaction_csv_exporter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ defmodule Explorer.Chain.CSVExport.AddressTransactionCsvExporter do
7979
|> Stream.map(fn transaction ->
8080
{opening_price, closing_price} = date_to_prices[DateTime.to_date(Transaction.block_timestamp(transaction))]
8181
price = exchange_rate.usd_value || closing_price || opening_price || Decimal.new("0")
82-
total_value_usd = Wei.mult(transaction.value, price)
82+
total_value_usd = transaction.value |> Wei.to(:ether) |> Decimal.mult(price)
8383
[
8484
to_string(transaction.hash),
8585
transaction.block_number,
@@ -91,7 +91,7 @@ defmodule Explorer.Chain.CSVExport.AddressTransactionCsvExporter do
9191
Address.checksum(transaction.created_contract_address_hash),
9292
type(transaction, address_hash),
9393
Wei.to(transaction.value, :wei),
94-
Wei.to(total_value_usd, :ether),
94+
total_value_usd,
9595
fee(transaction),
9696
transaction.status,
9797
transaction.error,

0 commit comments

Comments
 (0)