pull/2610/head
Ayrat Badykov 5 years ago
parent 44cf49ea75
commit ff1b7568d6
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 9
      apps/block_scout_web/lib/block_scout_web/views/chain_view.ex

@ -3,8 +3,13 @@ defmodule BlockScoutWeb.ChainView do
alias BlockScoutWeb.LayoutView
defp market_cap(:standard, exchange_rate) do
Decimal.mult(exchange_rate.available_supply, exchange_rate.usd_value)
defp market_cap(:standard, %{available_supply: available_supply, usd_value: usd_value})
when is_nil(available_supply) or is_nil(usd_value) do
Decimal.new(0)
end
defp market_cap(:standard, %{available_supply: available_supply, usd_value: usd_value}) do
Decimal.mult(available_supply, usd_value)
end
defp market_cap(module, exchange_rate) do

Loading…
Cancel
Save