Skip to content

Commit

Permalink
Adding a rounding mode to DK sale prices
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavigdis committed Jul 18, 2024
1 parent 9527ad4 commit 4bd2c8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Helpers/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) ) {
Expand Down

0 comments on commit 4bd2c8c

Please sign in to comment.