فهرست منبع

fixed currency format

Josh 4 سال پیش
والد
کامیت
134cc1ea50
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 6 0
      app/Helpers/helpers.php
  2. 2 2
      resources/views/app/dashboard.blade.php

+ 6 - 0
app/Helpers/helpers.php

@@ -70,6 +70,12 @@ if(!function_exists('friendly_month')) {
     }
 }
 
+if(!function_exists('friendly_money')){
+    function friendly_money($value){
+        return number_format((float)$value, 2, '.', '');
+    }
+}
+
 if(!function_exists('time_in_hrminsec')) {
     function time_in_hrminsec($value, $default = '-') {
         if(!$value || empty($value)) return $default;

+ 2 - 2
resources/views/app/dashboard.blade.php

@@ -48,7 +48,7 @@
                         <table class="table table-condensed table-bordered m-0">
                             <tbody>
                                 <tr>
-                                    <th class="px-2">{{$reimbursement['currentBalance']}}</th>
+                                    <th class="px-2">${{friendly_money($reimbursement['currentBalance'])}}</th>
                                     <th class="pl-2"><a href="/practice-management/financial-transactions">Current balance</a></th>
                                 </tr>
                                 <tr>
@@ -56,7 +56,7 @@
                                     <th class="pl-2">Next Payment Date</th>
                                 </tr>
                                 <tr>
-                                    <th class="px-2">{{$reimbursement['nextPaymentAmount']}}</th>
+                                    <th class="px-2">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
                                     <th class="pl-2">Next Payment Amount</th>
                                 </tr>
                                 {{--