This commit is contained in:
2024-11-23 17:19:25 +05:00
parent 2aa8bf9869
commit d8f847346b
7 changed files with 51 additions and 19 deletions

View File

@@ -202,18 +202,21 @@ function localeAppUrl(): string
return config('app.locale_app.url');
}
function convertToOriginalFormat($apiPrice) {
function convertToOriginalFormat($apiPrice)
{
// Convert to float and divide by 100
$originalPrice = intval($apiPrice) / 100;
return number_format($originalPrice, 2, '.', ''); // Format with 2 decimal places
}
function lastDayOfMonth($month, $year) {
function lastDayOfMonth($month, $year)
{
// Create a DateTime object for the first day of the given month
$date = new DateTime("$year-$month-01");
// Modify the date to the last day of the same month
$date->modify('last day of this month');
// Return the formatted date
return $date->format('d');
}