use OOB laravel helper method

This commit is contained in:
hackerESQ
2024-08-10 13:40:35 -05:00
parent 9623989fb0
commit 71e299be04
3 changed files with 22 additions and 22 deletions
+12 -12
View File
@@ -1,15 +1,15 @@
<?php
if (!function_exists('formatMoney')) {
/**
* Returns a formatted string for currency
*
* @param int|float $amount
*
* */
function formatMoney(int|float $amount) {
$formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY);
// if (!function_exists('formatMoney')) {
// /**
// * Returns a formatted string for currency
// *
// * @param int|float $amount
// *
// * */
// function formatMoney(int|float $amount) {
// $formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY);
return $formatter->formatCurrency((float) $amount, 'USD');
}
}
// return $formatter->formatCurrency((float) $amount, 'USD');
// }
// }