From 2591453d18ea879e5fc2b879cdb37bb6af863b9d Mon Sep 17 00:00:00 2001 From: Alda Vigdis Skarphedinsdottir Date: Thu, 18 Jul 2024 12:27:56 +0200 Subject: [PATCH] Adding a rounding mode to DK sale prices (#168) --- src/Helpers/Product.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Helpers/Product.php b/src/Helpers/Product.php index 0d14b43..bf97085 100644 --- a/src/Helpers/Product.php +++ b/src/Helpers/Product.php @@ -208,7 +208,10 @@ public static function format_sale_price_for_dk( roundingMode: RoundingMode::HALF_UP ); - return $price->dividedBy( $tax_fraction->plus( 1 ) )->toFloat(); + return $price->dividedBy( + $tax_fraction->plus( 1 ), + roundingMode: RoundingMode::HALF_UP + )->toFloat(); } } else { if ( ! empty( $wc_product->get_sale_price() ) ) {