@props([ 'small' => false, 'percent' => null, 'costBasis' => null, 'marketValue' => null ]) @php if (!is_null($percent)) { $isUp = $percent > 0; } else { $isUp = $costBasis <= $marketValue; $percent = $costBasis ? (($marketValue - $costBasis) / $costBasis) * 100 : 0; } @endphp @if(!empty($percent)) {!! $isUp ? '▲' :'▼' !!} {{ Number::percentage( abs($percent), ($percent && $small) < 1 ? 2 : 0 ) }} @endif