public static function formatMoney($number, $locale = null, $internationalFormat = null, $format = true)
{
$number = number_format($number, 2, '.', '');
if ($format) {
setlocale(LC_MONETARY, null);
setlocale(LC_MONETARY, empty($locale) ? config('laracart.locale', 'en_US.UTF-8') : $locale);
if (empty($internationalFormat) === true) {
$internationalFormat = config('laracart.international_format', false);
}
$number = money_format($internationalFormat ? '%i' : '%n', $number);
}
return $number;
}