{{-- Preview margin --}}
@if ($buy_price > 0 && $sell_price > 0)
@php
$margin = (float) $sell_price - (float) $buy_price;
$marginPct = $buy_price > 0 ? round($margin / (float) $buy_price * 100, 1) : 0;
@endphp
Margin kotor: Rp {{ number_format($margin, 0, ',', '.') }}
({{ $marginPct }}%)