Skip to content

Commit

Permalink
Adding a rounding mode to DK sale prices (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavigdis authored Jul 18, 2024
1 parent 9527ad4 commit 2591453
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 2591453

Please sign in to comment.