Fix Division by Zero

This commit is contained in:
R
2023-02-04 08:46:44 +07:00
parent 5d56434aa2
commit 5028b2d82b

View File

@@ -26,7 +26,7 @@ class DashboardResources extends JsonResource
'myLimit' => [
'balance' => $myLimitBalance,
'total' => $myLimitTotal,
'percentage' => ($myLimitBalance / $myLimitTotal) * 100,
'percentage' => $myLimitTotal ? (($myLimitBalance / $myLimitTotal) * 100) : 0,
],
'lockLimit' => [
'balance' => $lockBalance,