Skip to content

Commit

Permalink
show 4 decimals for annual fees if below 1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Nov 12, 2024
1 parent ddf4aa5 commit 4b42288
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions resources/views/components/stats/insights/annual.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
<div class="flex flex-col space-y-2">
<span>@lang('pages.statistics.insights.annual.header.fees')</span>
<span class="text-theme-secondary-900 dark:text-theme-dark-50">
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 8) }}
@if ($year['fees'] < 1)
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 4) }}
@else
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 2) }}
@endif
</span>
</div>

Expand Down Expand Up @@ -84,7 +88,11 @@
<div class="flex justify-between space-x-3">
<span>@lang('pages.statistics.insights.annual.header.fees'):</span>
<span class="text-theme-secondary-900 dark:text-theme-dark-50">
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 8) }}
@if ($year['fees'] < 1)
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 4) }}
@else
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 2) }}
@endif
</span>
</div>
</div>
Expand Down Expand Up @@ -127,7 +135,11 @@
<div class="flex justify-between px-8 space-x-3">
<span>@lang('pages.statistics.insights.annual.header.fees'):</span>
<span class="text-theme-secondary-900 dark:text-theme-dark-50">
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 8) }}
@if ($year['fees'] < 1)
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 4) }}
@else
{{ ExplorerNumberFormatter::currencyWithDecimals($year['fees'], Network::currency(), 2) }}
@endif
</span>
</div>
</td>
Expand Down

0 comments on commit 4b42288

Please sign in to comment.