diff --git a/CHANGELOG.md b/CHANGELOG.md index d6868dceff..b8b46de6f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector ### Fixes +- [#4768](https://github.com/blockscout/blockscout/pull/4768) - Block Details page: handle zero division - [#4751](https://github.com/blockscout/blockscout/pull/4751) - Change text and link for `trade STAKE` button - [#4746](https://github.com/blockscout/blockscout/pull/4746) - Fix comparison of decimal value - [#4711](https://github.com/blockscout/blockscout/pull/4711) - Add trimming to the contract functions inputs diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index ded7be1c09..03849dd586 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -171,7 +171,7 @@ text: gettext("The total gas amount used in the block and its percentage of gas filled in the block.") %> <%= gettext("Gas Used") %> -
<%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %> | <%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>
+
<%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %> | <%= if Decimal.cmp(@block.gas_limit, 0) == :eq, do: "0%", else: ((Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%")) %>