From a1253f525f8814dcea93c3e1282bd174e59c12ac Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Wed, 20 Dec 2023 07:54:05 +0200 Subject: [PATCH] Update on price calculation --- epp/src/helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epp/src/helpers.php b/epp/src/helpers.php index f63300f..5607dcb 100644 --- a/epp/src/helpers.php +++ b/epp/src/helpers.php @@ -502,7 +502,7 @@ function getDomainPrice($pdo, $domain_name, $tld_id, $date_add = 12, $command = "); $stmt->execute([$domain_name, $tld_id]); if ($stmt->rowCount() > 0) { - return ['type' => 'premium', 'price' => $stmt->fetch()['category_price']]; + return ['type' => 'premium', 'price' => number_format((float)$stmt->fetch()['category_price'], 2, '.', '')]; } // Check if there is a promotion for the domain @@ -546,10 +546,10 @@ function getDomainPrice($pdo, $domain_name, $tld_id, $date_add = 12, $command = $discountAmount = $discount; } $price = $regularPrice - $discountAmount; - return ['type' => 'promotion', 'price' => $price]; + return ['type' => 'promotion', 'price' => number_format((float)$price, 2, '.', '')]; } - return ['type' => 'regular', 'price' => $regularPrice]; + return ['type' => 'regular', 'price' => number_format((float)$regularPrice, 2, '.', '')]; } return ['type' => 'not_found', 'price' => 0];