Skip to content

Commit d44665b

Browse files
committed
AC-13855: Penny rounding error in catalog rule
Update decimal precision to 3 while saving price to DB
1 parent 79b630b commit d44665b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Directory/Model/PriceCurrency.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
class PriceCurrency implements \Magento\Framework\Pricing\PriceCurrencyInterface
1717
{
18+
const PRECISION_TO_FIX_PENNY_ROUNDING_ERROR = 3;
19+
1820
/**
1921
* @var \Magento\Store\Model\StoreManagerInterface
2022
*/
@@ -152,7 +154,7 @@ protected function getStore($scope = null)
152154
*/
153155
public function round($price)
154156
{
155-
return round((float) $price, 2);
157+
return round((float) $price, self::PRECISION_TO_FIX_PENNY_ROUNDING_ERROR);
156158
}
157159

158160
/**

0 commit comments

Comments
 (0)