Skip to content

Magento 2: Problem in rounding the price of a bundle product

I am not an expert in Magento and I have a problem with the sum of my bundle product when it shows the final price.
Product Issue

The total sum of the product should be 4,850.00 but as we see it shows 4,849.99 and it should not be like that, if I inspect the code of my browser I see that the data-price-amount is 4850 and it should be the same as what is printed on the span tag with class “price”.

Chrome

The closest thing I can find where this value is printed is in the following paths that are from my theme /app/code/Smartwave/Dailydeals/view/frontend/templates/product/price/final_price.phtml & /app /design/frontend/Smartwave/porto/Magento_Catalog/templates/product/price/final_price.phtml

Code

Where the $deal_final_price_amount is the final calculated price and the first time it is calculated with the data-price-amount it comes out correct at 4850 closed, but in the price span it comes out with decimals.

Note: the total sum of my products with the tax configuration in “total” gives 4849.993903 but for this reason I have the tax configuration in “Unit Price” so that it adds up to 4850.