diff --git a/src/LaraCart.php b/src/LaraCart.php index b7f0027..6d598bf 100644 --- a/src/LaraCart.php +++ b/src/LaraCart.php @@ -95,7 +95,7 @@ public function formatMoney($number, $locale = null, $internationalFormat = null return money_format($internationalFormat ? '%i' : '%n', $number); } - return number_format($number, 2); + return number_format($number, 2, '.', ''); } /** @@ -461,11 +461,7 @@ public function feeTotals($format = true) } } - if ($format) { - return $this->formatMoney($feeTotal); - } - - return number_format($feeTotal, 2); + return $this->formatMoney($feeTotal, null, null, $format); } /** @@ -484,11 +480,7 @@ public function totalDiscount($format = true) } - if ($format) { - return $this->formatMoney($total); - } - - return $total; + return $this->formatMoney($total, null, null, $format); } @@ -503,11 +495,8 @@ public function taxTotal($format = true) { $totalTax = $this->total(false, false) - $this->subTotal(false, false, false) - $this->feeTotals(false); - if ($format) { - return $this->formatMoney($totalTax); - } - return number_format($totalTax, 2); + return $this->formatMoney($totalTax, null, null, $format); } /** @@ -528,12 +517,7 @@ public function subTotal($tax = false, $format = true, $withDiscount = true) } } - if ($format) { - return $this->formatMoney($total); - } - - - return number_format($total, 2); + return $this->formatMoney($total, null, null, $format); } /** @@ -552,10 +536,6 @@ public function total($format = true, $withDiscount = true) $total -= $this->totalDiscount(false); } - if ($format) { - return $this->formatMoney($total); - } - - return number_format($total, 2); + return $this->formatMoney($total, null, null, $format); } }