Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

bytefury/crater

8213 stars
2 code files
View bytefury/crater on GitHub

app/Space/helpers.php

Open in GitHub
//
function format_money_pdf($money, $currency = null)
{
$money = $money / 100;
 
if (! $currency) {
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', 1));
}
 
$format_money = number_format(
$money,
$currency->precision,
$currency->decimal_separator,
$currency->thousand_separator
);
 
$currency_with_symbol = '';
if ($currency->swap_currency_symbol) {
$currency_with_symbol = $format_money.'<span style="font-family: DejaVu Sans;">'.$currency->symbol.'</span>';
} else {
$currency_with_symbol = '<span style="font-family: DejaVu Sans;">'.$currency->symbol.'</span>'.$format_money;
}
 
return $currency_with_symbol;
}
//

resources/views/app/pdf/invoice/partials/table.blade.php

Open in GitHub
// ...
 
{!! format_money_pdf($item->price, $invoice->user->currency) !!}
 
// ...

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.