This commit is contained in:
hackerESQ
2024-08-27 18:12:51 -05:00
parent 10b6c7cda2
commit db01c27113
12 changed files with 202 additions and 67 deletions
@@ -0,0 +1,27 @@
@php
if (isset($percent)) {
$isUp = $percent > 0;
} else {
$isUp = $costBasis <= $marketValue;
$percent = ($marketValue - $costBasis) / $costBasis;
}
@endphp
@if(!empty($percent))
<x-badge class="badge-sm {{ $isUp ? 'badge-success' : 'badge-error' }} badge-outline ml-2">
<x-slot:value>
{!! $isUp ? '&#9650;' :'&#9660;' !!}
{{ Number::percentage(
$percent,
$percent < 1 ? 2 : 0
) }}
</x-slot:value>
</x-badge>
@endif